Skip to content

Commit 2df201e

Browse files
Linus Walleijbroonie
authored andcommitted
spi: Support high CS when using descriptors
All controllers using GPIO descriptors can by definition support high CS connections, so just enforce this when registering an SPI controller. This fixes a regression where controllers were missing SPI_CS_HIGH, the drivers would fail like this: spi spi0.0: setup: unsupported mode bits 4 cdns-spi fd0b0000.spi: can't setup spi0.0, status -22 This is because as using descriptors moves the CS inversion logic over to gpiolib, all such controllers are registered with CS active high. Cc: Jan Kotas <jank@cadence.com> Reported-by: Jan Kotas <jank@cadence.com> Tested-by: Jan Kotas <jank@cadence.com> Fixes: f3186dd ("spi: Optionally use GPIO descriptors for CS GPIOs") Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent f0125f1 commit 2df201e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/spi/spi.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2279,6 +2279,11 @@ int spi_register_controller(struct spi_controller *ctlr)
22792279
status = spi_get_gpio_descs(ctlr);
22802280
if (status)
22812281
return status;
2282+
/*
2283+
* A controller using GPIO descriptors always
2284+
* supports SPI_CS_HIGH if need be.
2285+
*/
2286+
ctlr->mode_bits |= SPI_CS_HIGH;
22822287
} else {
22832288
/* Legacy code path for GPIOs from DT */
22842289
status = of_spi_register_master(ctlr);

0 commit comments

Comments
 (0)