aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-gpio.c
diff options
context:
space:
mode:
authorSerge Semin <fancer.lancer@gmail.com>2019-04-26 13:30:07 +0300
committerMark Brown <broonie@kernel.org>2019-05-02 10:38:00 +0900
commitd61ad23cb3be09ff4956e9b9794134456522817f (patch)
tree20f0633d03bb704571d4abaeacb37f9f60bc1bb4 /drivers/spi/spi-gpio.c
parentspi: ep93xx: Convert to use CS GPIO descriptors (diff)
downloadlinux-dev-d61ad23cb3be09ff4956e9b9794134456522817f.tar.xz
linux-dev-d61ad23cb3be09ff4956e9b9794134456522817f.zip
spi: Clear SPI_CS_HIGH flag from bad_bits for GPIO chip-select
When GPIO chip-select is used nothing prevents any available SPI controllers to work with both CS-high and traditional CS-low modes. In fact the SPI bus core code already does it, so we don't need to introduce any modification there. But spi_setup() still fails to switch the interface settings if CS-high flag is set for the case of GPIO-driven slave chip-select when the SPI controller doesn't support the hardwired CS-inversion. Lets fix it by clearing the SPI_CS_HIGH flag out from bad_bits (unsupported by controller) when client chip is selected by GPIO. This feature is useful for slave devices, which in accordance with communication protocol can work with both active-high and active-low chip-selects. I am aware of one such device. It is MMC-SPI interface, when at init sequence the driver needs to perform a read operation with low and high chip-select sequentially (requirement of 74 clock cycles with both chipselect, see the mmc_spi driver for details). Signed-off-by: Serge Semin <fancer.lancer@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-gpio.c')
0 files changed, 0 insertions, 0 deletions