Skip to content

Commit f0537b9

Browse files
committed
spi: dw: Handle any number of gpiod CS lines
Even when configured to use only gpiod CS lines, the DW SPI controller still expects a bit to be set in the SER register, otherwise transfers stall. For the csgpiod case, nominate bit 0 for the job. See: #6159 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
1 parent abc5014 commit f0537b9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/spi/spi-dw-core.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ void dw_spi_set_cs(struct spi_device *spi, bool enable)
9898
* support active-high or active-low CS level.
9999
*/
100100
if (cs_high == enable)
101-
dw_writel(dws, DW_SPI_SER, BIT(spi_get_chipselect(spi, 0)));
101+
dw_writel(dws, DW_SPI_SER,
102+
BIT(spi_get_csgpiod(spi, 0) ? 0 : spi_get_chipselect(spi, 0)));
102103
else
103104
dw_writel(dws, DW_SPI_SER, 0);
104105
}

0 commit comments

Comments
 (0)