Skip to content

Commit d4b551b

Browse files
smalaenashif
authored andcommitted
drivers: spi: siwx91x: Swap write and read data inside GSPI controller
Swap the write and read data paths within the GSPI controller to ensure correct data is seen on the SPI lines during 16-bit transfers. Signed-off-by: Sai Santhosh Malae <Santhosh.Malae@silabs.com>
1 parent b6cef6f commit d4b551b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/spi/spi_silabs_siwx91x_gspi.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,9 @@ static int gspi_siwx91x_config(const struct device *dev, const struct spi_config
176176
/* Update the number of Data Bits */
177177
cfg->reg->GSPI_WRITE_DATA2 = SPI_WORD_SIZE_GET(spi_cfg->operation);
178178

179-
/* Swap the read data inside the GSPI controller it-self */
180-
cfg->reg->GSPI_CONFIG2_b.GSPI_RD_DATA_SWAP_MNL_CSN0 = 0;
179+
/* Swap the write and read data inside the GSPI controller it-self */
180+
cfg->reg->GSPI_CONFIG2_b.GSPI_RD_DATA_SWAP_MNL_CSN0 = 1;
181+
cfg->reg->GSPI_CONFIG2_b.GSPI_WR_DATA_SWAP_MNL_CSN0 = 1;
181182

182183
/* Enable full-duplex mode and manual read/write */
183184
cfg->reg->GSPI_CONFIG1_b.SPI_FULL_DUPLEX_EN = 1;

0 commit comments

Comments
 (0)