]> git.baikalelectronics.ru Git - kernel.git/commit
staging: fbtft: Do not hardcode SPI CS polarity inversion
authorLinus Walleij <linus.walleij@linaro.org>
Wed, 4 Dec 2019 23:32:30 +0000 (00:32 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 10 Dec 2019 09:56:53 +0000 (10:56 +0100)
commit82e9f5c0a3425616f5b66a2fbdc751437b9ba3a8
treef73ac7fe244e18d761349b8a0fae806119c72fd3
parent72b39d4329061abcd1894622afc39125d1bd53e7
staging: fbtft: Do not hardcode SPI CS polarity inversion

The current use of the mode flag SPI_CS_HIGH is fragile: it
overwrites anything already assigned by the SPI core.

Assign ^= SPI_CS_HIGH since we might be active high
already, and that is usually the case with GPIOs used
for chip select, even if they are in practice active low.

Add a comment clarifying why ^= SPI_CS_HIGH is the right
choice here.

Reported-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20191204233230.22309-1-linus.walleij@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/fbtft/fb_uc1611.c
drivers/staging/fbtft/fb_watterott.c