]> git.ipfire.org Git - thirdparty/openwrt.git/commit
treewide: dts: fix spi-gpio chip select GPIO polarity 19845/head
authorShiji Yang <yangshiji66@outlook.com>
Mon, 1 Sep 2025 01:17:49 +0000 (09:17 +0800)
committerHauke Mehrtens <hauke@hauke-m.de>
Sun, 19 Oct 2025 22:28:15 +0000 (00:28 +0200)
commitc2e5bded8d0654ba6f696957cb493d607e36a8a6
tree94d8d290d9534e71fdfa4070fb48e28b89fd32b2
parentb291e0ded404cfe0cc310cbba7602168c5380ec6
treewide: dts: fix spi-gpio chip select GPIO polarity

The SPI chip select GPIO polarity is active low by default. We must
use "spi-cs-high" dts property to toggle the polarity. The polarity
on "cs-gpios" won't take effect at all[1]. Fix these incorrect GPIO
polarities to silence the kernel warnings.

[1] Refer to Linux/Documentation/devicetree/bindings/spi/spi-controller.yaml
```
      device node     | cs-gpio       | CS pin state active | Note
      ================+===============+=====================+=====
      spi-cs-high     | -             | H                   |
      -               | -             | L                   |
      spi-cs-high     | ACTIVE_HIGH   | H                   |
      -               | ACTIVE_HIGH   | L                   | 1
      spi-cs-high     | ACTIVE_LOW    | H                   | 2
      -               | ACTIVE_LOW    | L                   |

      Notes:
      1) Should print a warning about polarity inversion.
         Here it would be wise to avoid and define the gpio as
         ACTIVE_LOW.
      2) Should print a warning about polarity inversion
         because ACTIVE_LOW is overridden by spi-cs-high.
         Should be generally avoided and be replaced by
         spi-cs-high + ACTIVE_HIGH.
```

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/19845
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
target/linux/ath79/dts/ar7242_ubnt_sw.dtsi
target/linux/ath79/dts/qca9531_tplink_tl-mr3420-v3.dts
target/linux/ath79/dts/qca9558_ubnt_nanobeam-ac-xc.dts
target/linux/ath79/dts/qca9561_tplink_archer-c25-v1.dts
target/linux/ath79/dts/qca9561_tplink_archer-c5x.dtsi
target/linux/ath79/dts/qca9563_tplink_archer-c7-v4.dts
target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4018-rutx50.dts
target/linux/ramips/dts/mt7628an_teltonika_rut9xx.dtsi