Message ID | 20181012170337.681EC440078@finisterre.ee.mobilebroadband (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Applied "spi: Make GPIO CSs honour the SPI_NO_CS flag" to the spi tree | expand |
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index fcbd4cfd2818..ea3e5e146764 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -775,7 +775,9 @@ static void spi_set_cs(struct spi_device *spi, bool enable) enable = !enable; if (gpio_is_valid(spi->cs_gpio)) { - gpio_set_value(spi->cs_gpio, !enable); + /* Honour the SPI_NO_CS flag */ + if (!(spi->mode & SPI_NO_CS)) + gpio_set_value(spi->cs_gpio, !enable); /* Some SPI masters need both GPIO CS & slave_select */ if ((spi->controller->flags & SPI_MASTER_GPIO_SS) && spi->controller->set_cs)