diff options
author | Mark Brown <broonie@kernel.org> | 2016-12-12 16:54:03 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-12-12 16:54:03 +0100 |
commit | 05232669503f54babf9f899748baf02934fd1051 (patch) | |
tree | 39155671837d79313a7c25c1a1c98f1527123dfb /drivers/spi/spi.c | |
parent | Merge remote-tracking branches 'spi/fix/atmel', 'spi/fix/mvbeu' and 'spi/fix/... (diff) | |
parent | spi: Add Flag to Enable Slave Select with GPIO Chip Select. (diff) | |
download | linux-05232669503f54babf9f899748baf02934fd1051.tar.xz linux-05232669503f54babf9f899748baf02934fd1051.zip |
Merge remote-tracking branch 'spi/topic/core' into spi-next
Diffstat (limited to 'drivers/spi/spi.c')
-rw-r--r-- | drivers/spi/spi.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 838783c3fed0..91b25314ba03 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -697,10 +697,15 @@ static void spi_set_cs(struct spi_device *spi, bool enable) if (spi->mode & SPI_CS_HIGH) enable = !enable; - if (gpio_is_valid(spi->cs_gpio)) + if (gpio_is_valid(spi->cs_gpio)) { gpio_set_value(spi->cs_gpio, !enable); - else if (spi->master->set_cs) + /* Some SPI masters need both GPIO CS & slave_select */ + if ((spi->master->flags & SPI_MASTER_GPIO_SS) && + spi->master->set_cs) + spi->master->set_cs(spi, !enable); + } else if (spi->master->set_cs) { spi->master->set_cs(spi, !enable); + } } #ifdef CONFIG_HAS_DMA |