diff options
author | Kris Bahnsen <kris@embeddedTS.com> | 2022-12-08 00:08:53 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2022-12-08 12:46:41 +0100 |
commit | 3a6f994f848a69deb2bf3cd9d130dd0c09730e55 (patch) | |
tree | ec4851ff82740512b4ac69dadfd88ce135b96962 /drivers/spi/spi-uniphier.c | |
parent | spi: spi-mtk-nor: Add recovery mechanism for dma read timeout (diff) | |
download | linux-3a6f994f848a69deb2bf3cd9d130dd0c09730e55.tar.xz linux-3a6f994f848a69deb2bf3cd9d130dd0c09730e55.zip |
spi: spi-gpio: Don't set MOSI as an input if not 3WIRE mode
The addition of 3WIRE support would affect MOSI direction even
when still in standard (4 wire) mode. This can lead to MOSI being
at an invalid logic level when a device driver sets an SPI
message with a NULL tx_buf.
spi.h states that if tx_buf is NULL then "zeros will be shifted
out ... " If MOSI is tristated then the data shifted out is subject
to pull resistors, keepers, or in the absence of those, noise.
This issue came to light when using spi-gpio connected to an
ADS7843 touchscreen controller. MOSI pulled high when clocking
MISO data in caused the SPI device to interpret this as a command
which would put the device in an unexpected and non-functional
state.
Fixes: 4b859db2c606 ("spi: spi-gpio: add SPI_3WIRE support")
Fixes: 5132b3d28371 ("spi: gpio: Support 3WIRE high-impedance turn-around")
Signed-off-by: Kris Bahnsen <kris@embeddedTS.com>
Link: https://lore.kernel.org/r/20221207230853.6174-1-kris@embeddedTS.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-uniphier.c')
0 files changed, 0 insertions, 0 deletions