Revert "DTS: ARM: gta04: introduce legacy spi-cs-high to make display work again"
Subsystems (2)
A message that is not in the archive (sent off-list or not yet received): [email protected]
RFC 1/2 Revert "DTS: ARM: gta04: introduce legacy spi-cs-high to make display work again"
This reverts commit f1f028ff89cb.
commit 6953c57ab172 ("gpio: of: Handle SPI chipselect legacy bindings")
did introduce logic to centrally handle the legacy spi-cs-high property in combination with cs-gpios. This assumes that the polarity of the CS has to be inverted if spi-cs-high is missing, even and especially if non-legacy GPIO_ACTIVE_HIGH is specified.
As a result we had to introduce spi-cs-high to the device tree by
commit f1f028ff89cb ("DTS: ARM: gta04: introduce legacy spi-cs-high to make display work again")
Now,
commit 766c6b63aa04 ("spi: fix client driver breakages when using GPIO descriptors")
removes this inversion logic again and the GTA04 display is broken again.
So we have to revert the device tree change again.
But we should revert it only if
commit 766c6b63aa04 ("spi: fix client driver breakages when using GPIO descriptors")
is present in some kernel version. Hence this is the Fixes: reference and not the original change.
--- arch/arm/boot/dts/omap3-gta04.dtsi | 1 - 1 file changed, 1 deletion(-)
arch/arm/boot/dts/omap3-gta04.dtsi +0 -1
@@ -149,7 +149,6 @@ lcd: td028ttec1@0 { spi-max-frequency = <100000>; spi-cpol; spi-cpha; - spi-cs-high; backlight= <&backlight>; label = "lcd";
Signature · 1 line
2.26.2
RFC 2/2 DTS: ARM: gta04: SPI panel chip select is active low
In reply to a message not in the archiveHistorically the panel driver did know the polarity and the device tree introduced by
commit c2e138bc8ed8 ("ARM: dts: omap3-gta04: Add display support")
as
cs-gpios = <&gpio1 19 0>;
The 0 was ignored because the spi-gpio driver did only look at the presence of an spi-cs-high property. Since it was not present, the CS was active low.
commit 3a637e008e54 ("ARM: dts: Use defined GPIO constants in flags cell for OMAP2+ boards")
replaced the constant 0 by the constant GPIO_ACTIVE_HIGH which was no problem because it was still ignored.
Starting with
commit 6953c57ab172 ("gpio: of: Handle SPI chipselect legacy bindings")
the gpiolib and spi-gpio drivers tried to handle both properties by making an inversion for GPIO_ACTIVE_HIGH definitions.
To keep the device tree compatible with older kernels which ignored the GPIO_ACTIVE property we just added spi-cs-high;.
This tells the inversion logic that we want an active low chip select as defined by the rule documented by the commit message of
commit 6953c57ab172 ("gpio: of: Handle SPI chipselect legacy bindings")
"If the line is tagged as active high in the device tree with
the second cell flag and has no "spi-cs-high" property we enforce active low semantics (as this is the exception we can just tag on the flag)."
This went well until
commit 766c6b63aa04 ("spi: fix client driver breakages when using GPIO descriptors")
arrived which effectively removes the inversion logic rule.
Removing spi-cs-high; in a separate patch already solves the urgent problem, but to remove
[ 3.629791] td028ttec1@0 enforce active low on chipselect handle
and to be safe against future changes of such rules we also define the cs-gpio explicitly as GPIO_ACTIVE_LOW.
Note that this patch breaks all kernels between
commit 6953c57ab172 ("gpio: of: Handle SPI chipselect legacy bindings") and
commit 766c6b63aa04 ("spi: fix client driver breakages when using GPIO descriptors")
--- arch/arm/boot/dts/omap3-gta04.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/omap3-gta04.dtsi +1 -1
@@ -139,7 +139,7 @@ spi_lcd: spi_lcd { gpio-sck = <&gpio1 12 GPIO_ACTIVE_HIGH>; gpio-miso = <&gpio1 18 GPIO_ACTIVE_HIGH>; gpio-mosi = <&gpio1 20 GPIO_ACTIVE_HIGH>; - cs-gpios = <&gpio1 19 GPIO_ACTIVE_HIGH>; + cs-gpios = <&gpio1 19 GPIO_ACTIVE_LOW>; num-chipselects = <1>; /* lcd panel */
Signature · 1 line
2.26.2