ipq806x: dts: fix SPI chip select GPIO polarity
authorShiji Yang <[email protected]>
Sun, 24 Aug 2025 12:57:18 +0000 (20:57 +0800)
committerHauke Mehrtens <[email protected]>
Sun, 19 Oct 2025 22:28:15 +0000 (00:28 +0200)
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 <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/19845
Signed-off-by: Hauke Mehrtens <[email protected]>
32 files changed:
target/linux/ipq806x/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq8062-wg2600hp3.dts
target/linux/ipq806x/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq8064-ad7200-c2600.dtsi
target/linux/ipq806x/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq8064-e8350-v1.dts
target/linux/ipq806x/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq8064-fap-421e.dts
target/linux/ipq806x/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq8064-onhub.dtsi
target/linux/ipq806x/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq8064-unifi-ac-hd.dts
target/linux/ipq806x/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq8064-vr2600v.dts
target/linux/ipq806x/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq8064-wg2600hp.dts
target/linux/ipq806x/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq8064-wxr-2533dhp.dts
target/linux/ipq806x/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq8065-ac400i.dts
target/linux/ipq806x/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq8065-nbg6817.dts
target/linux/ipq806x/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq8065-rt4230w-rev6.dts
target/linux/ipq806x/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq8065-tr4400-v2.dts
target/linux/ipq806x/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq8068-ap3935.dts
target/linux/ipq806x/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq8068-ecw5410.dts
target/linux/ipq806x/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq8068-ss-w2-ac2600.dts
target/linux/ipq806x/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq8062-wg2600hp3.dts
target/linux/ipq806x/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq8064-ad7200-c2600.dtsi
target/linux/ipq806x/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq8064-e8350-v1.dts
target/linux/ipq806x/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq8064-fap-421e.dts
target/linux/ipq806x/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq8064-onhub.dtsi
target/linux/ipq806x/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq8064-unifi-ac-hd.dts
target/linux/ipq806x/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq8064-vr2600v.dts
target/linux/ipq806x/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq8064-wg2600hp.dts
target/linux/ipq806x/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq8064-wxr-2533dhp.dts
target/linux/ipq806x/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq8065-ac400i.dts
target/linux/ipq806x/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq8065-nbg6817.dts
target/linux/ipq806x/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq8065-rt4230w-rev6.dts
target/linux/ipq806x/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq8065-tr4400-v2.dts
target/linux/ipq806x/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq8068-ap3935.dts
target/linux/ipq806x/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq8068-ecw5410.dts
target/linux/ipq806x/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq8068-ss-w2-ac2600.dts

index 602c3b115ed032f1bff4488ee3f8cdb81d2f6f9b..03f66ea4af6d9f8df5e4f1ec14d8f924d3bcb7c8 100644 (file)
                pinctrl-0 = <&spi_pins>;
                pinctrl-names = "default";
 
-               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_HIGH>;
+               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_LOW>;
 
                flash@0 {
                        compatible = "jedec,spi-nor";
index c54ec40428661a017066fa10de6be1ac603b5334..3dd208e5126212bc92c51f82fcca83e4563ca05e 100644 (file)
@@ -89,7 +89,7 @@
                pinctrl-0 = <&spi_pins>;
                pinctrl-names = "default";
 
-               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_HIGH>;
+               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_LOW>;
 
                flash@0 {
                        compatible = "jedec,spi-nor";
index 52d6b77b492bff3d43a49d092d807861fa71a41e..eccd57186360b594d75ef4c419f1df88b18b71f4 100644 (file)
                pinctrl-0 = <&spi_pins>;
                pinctrl-names = "default";
 
-               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_HIGH>;
+               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_LOW>;
 
                m25p80@0 {
                        compatible = "jedec,spi-nor";
index 371fdbacb2ae6dbd83f546459b318b8c5ff0e94f..419f9fcfca5322f33eacb20ad873a614727303e8 100644 (file)
 
                pinctrl-0 = <&spi_pins>;
                pinctrl-names = "default";
-               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_HIGH>;
+               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_LOW>;
 
                flash@0 {
                        compatible = "jedec,spi-nor";
index 14c12ba053edc2249de32c0757a99d5ca619964c..bb7927453d79671b46b2c278db1d7bc5222c4201 100644 (file)
                pinctrl-0 = <&spi_pins>;
                pinctrl-names = "default";
 
-               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_HIGH>;
+               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_LOW>;
 
                flash: flash@0 {
                        compatible = "jedec,spi-nor";
        pinctrl-0 = <&spi6_pins>;
        pinctrl-names = "default";
 
-       cs-gpios = <&qcom_pinmux 57 GPIO_ACTIVE_HIGH>;
+       cs-gpios = <&qcom_pinmux 57 GPIO_ACTIVE_LOW>;
 
        dmas = <&adm_dma 8 0xb>,
               <&adm_dma 7 0x14>;
index 219af69ac91511fab5799b0d5b2b2d42899b4d16..e272348997583c7c09af813c052e8aa392b5848e 100644 (file)
 
                pinctrl-0 = <&spi_pins>;
                pinctrl-names = "default";
-               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_HIGH>;
+               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_LOW>;
 
                flash@0 {
                        compatible = "mx25u25635f", "jedec,spi-nor";
index 132ccbe1c2a947615c236edaa516114674f3853b..a1ed5fbfbe31c917c4862966effd1151ca5cea4f 100644 (file)
                pinctrl-0 = <&spi_pins>;
                pinctrl-names = "default";
 
-               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_HIGH>;
+               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_LOW>;
 
                flash@0 {
                        compatible = "jedec,spi-nor";
index 9e1f1057761705b57243ddf8195176bf5d87c2bf..f152681971119737cee3e32b07045cf3fcf8b24e 100644 (file)
@@ -288,7 +288,7 @@ switch@10 {
                pinctrl-0 = <&spi_pins>;
                pinctrl-names = "default";
 
-               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_HIGH>;
+               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_LOW>;
 
                flash@0 {
                        compatible = "jedec,spi-nor";
index 8c31dbcafa11613db95ba4345f48410cca1103c8..f37a9c4308dd2d0042bda1baf565a4246f3a7455 100644 (file)
                pinctrl-0 = <&spi_pins>;
                pinctrl-names = "default";
 
-               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_HIGH>;
+               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_LOW>;
 
                flash@0 {
                        compatible = "jedec,spi-nor";
index c6876480aab729968d5bf38ebfda3f0bf93fcd02..3ce55132c05175d2a5f7a5e915801d2e392aef53 100644 (file)
                pinctrl-0 = <&spi_pins>;
                pinctrl-names = "default";
 
-               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_HIGH>;
+               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_LOW>;
 
                m25p80@0 {
                        compatible = "jedec,spi-nor";
index 310ad98b57971840e6f7035e05ff96a0debe2a3a..6e1bbcc8c213f87ffe2dd656e1308e07c29152a5 100644 (file)
                pinctrl-0 = <&spi_pins>;
                pinctrl-names = "default";
 
-               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_HIGH>;
+               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_LOW>;
 
                m25p80@0 {
                        compatible = "jedec,spi-nor";
index 500f2f15f8107087a6d4718accae74693e3b7113..bf820d580df6f51bff6b8f01f41acc108db94696 100644 (file)
                pinctrl-0 = <&spi_pins>;
                pinctrl-names = "default";
 
-               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_HIGH>;
+               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_LOW>;
 
                flash@0 {
                        compatible = "everspin,mr25h256";
index 37c8dc29dd55e7a11d0da057d7daa47403496ec5..d9aee7ec8adef03f34b9bcc349df7ca944c1ef08 100644 (file)
                pinctrl-0 = <&spi_pins>;
                pinctrl-names = "default";
 
-               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_HIGH>;
+               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_LOW>;
 
                flash@0 {
                        compatible = "everspin,mr25h256";
index b1b3b661f15ec4d2d0f3c613970dd77b76372eab..6b6e97d8050f00656f58d7842773bf592cb82c31 100644 (file)
                pinctrl-0 = <&spi_pins>;
                pinctrl-names = "default";
 
-               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_HIGH>;
+               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_LOW>;
 
                flash@0 {
                        compatible = "jedec,spi-nor";
index 2bf793c41cc7a64d21ccf3301ad8ae78c45c7721..923e1a0d76c174d596f7ed50fbafe7dbf972d6c5 100644 (file)
                pinctrl-0 = <&spi_pins>;
                pinctrl-names = "default";
 
-               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_HIGH>;
+               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_LOW>;
 
                m25p80@0 {
                        compatible = "jedec,spi-nor";
index 6d43b80ad467c9ed40b50ceab6c51eeb30517cce..125322cf9a037df6a942dbc906e4e1b68dfbbea2 100644 (file)
                pinctrl-0 = <&spi_pins>;
                pinctrl-names = "default";
 
-               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_HIGH>;
+               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_LOW>;
 
                w25q128@0 {
                        compatible = "jedec,spi-nor";
index 76751910e01c4d4d00abd430ec2b4de7be0d6a15..485779b7a3dadff5efe7004225fef30b9871f9bd 100644 (file)
                pinctrl-0 = <&spi_pins>;
                pinctrl-names = "default";
 
-               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_HIGH>;
+               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_LOW>;
 
                flash@0 {
                        compatible = "jedec,spi-nor";
index d8e018367ebe874c97419dbcf26c1c228765df5e..5e7cce5354fc8e6d88bce3ae4c79d7f018eeccf6 100644 (file)
@@ -84,7 +84,7 @@
                pinctrl-0 = <&spi_pins>;
                pinctrl-names = "default";
 
-               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_HIGH>;
+               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_LOW>;
 
                flash@0 {
                        compatible = "jedec,spi-nor";
index 52d6b77b492bff3d43a49d092d807861fa71a41e..eccd57186360b594d75ef4c419f1df88b18b71f4 100644 (file)
                pinctrl-0 = <&spi_pins>;
                pinctrl-names = "default";
 
-               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_HIGH>;
+               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_LOW>;
 
                m25p80@0 {
                        compatible = "jedec,spi-nor";
index 813eb050b45d95e4e4e44999f7164c5046333035..38cdda5cd36c10eeee56bbf9227a94ef112e6831 100644 (file)
 
                pinctrl-0 = <&spi_pins>;
                pinctrl-names = "default";
-               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_HIGH>;
+               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_LOW>;
 
                flash@0 {
                        compatible = "jedec,spi-nor";
index 5b8de27ad69e518f49aa82fe319a36b1fbccb43b..03ac8e50a02e44f5fa67af78da27cc393b35b73e 100644 (file)
                pinctrl-0 = <&spi_pins>;
                pinctrl-names = "default";
 
-               cs-gpios = <&qcom_pinmux 20 0>;
+               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_LOW>;
 
                flash: flash@0 {
                        compatible = "jedec,spi-nor";
        pinctrl-0 = <&spi6_pins>;
        pinctrl-names = "default";
 
-       cs-gpios = <&qcom_pinmux 57 GPIO_ACTIVE_HIGH>;
+       cs-gpios = <&qcom_pinmux 57 GPIO_ACTIVE_LOW>;
 
        dmas = <&adm_dma 8 0xb>,
               <&adm_dma 7 0x14>;
index c415b5901ad39c94fd8c82b42072b7572e1eeef0..83534e2c748db823751f7b459807019748d38e14 100644 (file)
 
                pinctrl-0 = <&spi_pins>;
                pinctrl-names = "default";
-               cs-gpios = <&qcom_pinmux 20 0>;
+               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_LOW>;
 
                flash@0 {
                        compatible = "mx25u25635f", "jedec,spi-nor";
index 3df650eba4d6dc078fadf8a9b3ded5a3dde19fb4..1274fc34b0f29dc2993b33a13fa526babeb8b310 100644 (file)
                pinctrl-0 = <&spi_pins>;
                pinctrl-names = "default";
 
-               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_HIGH>;
+               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_LOW>;
 
                flash@0 {
                        compatible = "jedec,spi-nor";
index b97b4325f21e795ce4afd9dc979005d7b82265fc..ba1166929effea500b1d2263efab8e20dd7b5a38 100644 (file)
@@ -288,7 +288,7 @@ switch@10 {
                pinctrl-0 = <&spi_pins>;
                pinctrl-names = "default";
 
-               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_HIGH>;
+               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_LOW>;
 
                flash@0 {
                        compatible = "jedec,spi-nor";
index b3561cafe7613da27c80def8413c130a58fc3a5f..a707e62bc913fcaeba454c38ef6b4cdaadddcf82 100644 (file)
                pinctrl-0 = <&spi_pins>;
                pinctrl-names = "default";
 
-               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_HIGH>;
+               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_LOW>;
 
                flash@0 {
                        compatible = "jedec,spi-nor";
index 7151f8de525bb7270bd7d29d7e7e0f9bc12bfa19..16d7f534e8fdfdbc603b435dda4401f4a8b870aa 100644 (file)
                pinctrl-0 = <&spi_pins>;
                pinctrl-names = "default";
 
-               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_HIGH>;
+               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_LOW>;
 
                m25p80@0 {
                        compatible = "jedec,spi-nor";
index 9a9251e9b953058c2b53507e622c85a10560117c..75401bd6815833964fa9f527cad7e67602407442 100644 (file)
                pinctrl-0 = <&spi_pins>;
                pinctrl-names = "default";
 
-               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_HIGH>;
+               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_LOW>;
 
                m25p80@0 {
                        compatible = "jedec,spi-nor";
index cd63f92db65121ccb7ff8fe5543cce5ce6805cc6..5017e3561f60e3caac0d1ec325d6b5f3fe9576d9 100644 (file)
                pinctrl-0 = <&spi_pins>;
                pinctrl-names = "default";
 
-               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_HIGH>;
+               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_LOW>;
 
                flash@0 {
                        compatible = "everspin,mr25h256";
index 176ae2933762ce10b0a1e7ed6e668b6ef3787d75..bf9ee58ee15eabef95441c0dbf203b60207b21e0 100644 (file)
                pinctrl-0 = <&spi_pins>;
                pinctrl-names = "default";
 
-               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_HIGH>;
+               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_LOW>;
 
                flash@0 {
                        compatible = "everspin,mr25h256";
index f26d026be851d9ef998de719d90085e929d85dbf..cea512482609168c4d458522d1c46170ebae7521 100644 (file)
                pinctrl-0 = <&spi_pins>;
                pinctrl-names = "default";
 
-               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_HIGH>;
+               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_LOW>;
 
                flash@0 {
                        compatible = "jedec,spi-nor";
index 9f6c5fb696978402ff54a0f35861f44bc27af781..45b222b792831bc8e4261aae73629ec6d41dde36 100644 (file)
                pinctrl-0 = <&spi_pins>;
                pinctrl-names = "default";
 
-               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_HIGH>;
+               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_LOW>;
 
                m25p80@0 {
                        compatible = "jedec,spi-nor";
index 5174927a0f5e74162ca11aba26cd801d20489ab3..fa531694d60c106b574125aedc1e4666bcb7569c 100644 (file)
                pinctrl-0 = <&spi_pins>;
                pinctrl-names = "default";
 
-               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_HIGH>;
+               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_LOW>;
 
                w25q128@0 {
                        compatible = "jedec,spi-nor";