]> git.baikalelectronics.ru Git - kernel.git/commit
Revert "gpio/spi: Fix spi-gpio regression on active high CS"
authorLinus Walleij <linus.walleij@linaro.org>
Mon, 15 Jul 2019 20:45:29 +0000 (22:45 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Tue, 16 Jul 2019 08:55:37 +0000 (10:55 +0200)
commit349ffc8279f17c76e0c26c2ce7826ed46d8c0415
treefe5237a13c10339f38d8d948c33224dd21159e97
parent5e15766d80fbf9b750456f6f2a0ddedebbcd722e
Revert "gpio/spi: Fix spi-gpio regression on active high CS"

This reverts commit d621f207c7feb1db628d438c1f0dc72b3b350ad7.

It seems I was misguided in my fixup, which was working at the
time but did not work on the final v5.2.

The patch tried to avoid a quirk the gpiolib code not to treat
"spi-gpio" CS gpios "special" by enforcing them to be active
low, in the belief that since the "spi-gpio" driver was
parsing the device tree on its own, it did not care to inspect
the "spi-cs-high" attribute on the device nodes.

That's wrong. The SPI core was inspecting them inside the
of_spi_parse_dt() funtion and setting SPI_CS_HIGH on the
nodes, and the driver inspected this flag when driving the
line.

As of now, the core handles the GPIO and it will consistently
set the GPIO descriptor to 1 to enable CS, strictly requireing
the gpiolib to invert it. And the gpiolib should indeed
enforce active low on the CS line.

Device trees should of course put the right flag on the GPIO
handles, but it used to not matter. If we don't enforce active
low on "gpio-gpio" we may run into ABI backward compatibility
issues, so revert this.

Cc: linux-spi@vger.kernel.org
Cc: stable@vger.kernel.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20190715204529.9539-1-linus.walleij@linaro.org
drivers/gpio/gpiolib-of.c