Skip to content

Commit 3e7cc62

Browse files
Esben Haabendalbroonie
Esben Haabendal
authored andcommitted
spi: spi-fsl-dspi: Enable extended SPI mode
Set the XSPI bit for devices configured for XSPI mode (currently LS1021A), and thereby switch to extended SPI mode, allowing for SPI transfers using from 4 to 32 bits per word instead of 4 to 16 bits per word. Signed-off-by: Esben Haabendal <[email protected]> Acked-by: Martin Hundebøll <[email protected]> Signed-off-by: Mark Brown <[email protected]>
1 parent 35c9d46 commit 3e7cc62

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/spi/spi-fsl-dspi.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
#define SPI_MCR_PCSIS (0x3F << 16)
4747
#define SPI_MCR_CLR_TXF (1 << 11)
4848
#define SPI_MCR_CLR_RXF (1 << 10)
49+
#define SPI_MCR_XSPI (1 << 3)
4950

5051
#define SPI_TCR 0x08
5152
#define SPI_TCR_GET_TCNT(x) (((x) & 0xffff0000) >> 16)
@@ -968,7 +969,8 @@ static const struct regmap_config dspi_xspi_regmap_config[] = {
968969

969970
static void dspi_init(struct fsl_dspi *dspi)
970971
{
971-
regmap_write(dspi->regmap, SPI_MCR, SPI_MCR_MASTER | SPI_MCR_PCSIS);
972+
regmap_write(dspi->regmap, SPI_MCR, SPI_MCR_MASTER | SPI_MCR_PCSIS |
973+
(dspi->devtype_data->xspi_mode ? SPI_MCR_XSPI : 0));
972974
regmap_write(dspi->regmap, SPI_SR, SPI_SR_CLEAR);
973975
if (dspi->devtype_data->xspi_mode)
974976
regmap_write(dspi->regmap, SPI_CTARE(0),

0 commit comments

Comments
 (0)