OSDN Git Service

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)
commit453a4b6d8e1bdff2b8e1f56f4b8a8ef6d36b0e77
treef73ac7fe244e18d761349b8a0fae806119c72fd3
parent1184fd9966702a5a1cea73bdb6fe646b961c387c
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