ramips: gpio-ralink: use ngpios, not ralink,num-gpios
authorIlya Lipnitskiy <ilya.lipnitskiy@gmail.com>
Tue, 6 Apr 2021 05:53:46 +0000 (22:53 -0700)
committerChuanhong Guo <gch981213@gmail.com>
Wed, 14 Apr 2021 16:00:54 +0000 (00:00 +0800)
DTS properties that match *-gpios are treated specially.

Use ngpios instead, as most GPIO drivers upstream do.

Fixes 5.10 DTS errors such as:
  OF: /palmbus@300000/gpio@600: could not find phandle

Fixes DTC warnings such as:
  Warning (gpios_property): /palmbus@300000/gpio@600:ralink,num-gpios:
  Could not get phandle node for (cell 0)

Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
Cc: Daniel Golle <daniel@makrotopia.org>
13 files changed:
target/linux/ramips/dts/mt7620a.dtsi
target/linux/ramips/dts/mt7620n.dtsi
target/linux/ramips/dts/rt2880.dtsi
target/linux/ramips/dts/rt3050.dtsi
target/linux/ramips/dts/rt3352.dtsi
target/linux/ramips/dts/rt3883.dtsi
target/linux/ramips/dts/rt5350.dtsi
target/linux/ramips/patches-5.10/801-DT-Add-documentation-for-gpio-ralink.patch
target/linux/ramips/patches-5.10/802-GPIO-MIPS-ralink-add-gpio-driver-for-ralink-SoC.patch
target/linux/ramips/patches-5.10/804-staging-mt7621-pinctrl-use-ngpios-not-num-gpios.patch [new file with mode: 0644]
target/linux/ramips/patches-5.4/0026-DT-Add-documentation-for-gpio-ralink.patch
target/linux/ramips/patches-5.4/0027-GPIO-MIPS-ralink-add-gpio-driver-for-ralink-SoC.patch
target/linux/ramips/patches-5.4/804-staging-mt7621-pinctrl-use-ngpios-not-num-gpios.patch [new file with mode: 0644]

index afd638a386226dec16a004905589cef71bcc2ab7..c33dd135fef11b736ea40819a6ea1e7f9b5db43c 100644 (file)
                        gpio-controller;
                        #gpio-cells = <2>;
 
+                       ngpios = <24>;
                        ralink,gpio-base = <0>;
-                       ralink,num-gpios = <24>;
                        ralink,register-map = [ 00 04 08 0c
                                                20 24 28 2c
                                                30 34 ];
                        gpio-controller;
                        #gpio-cells = <2>;
 
+                       ngpios = <16>;
                        ralink,gpio-base = <24>;
-                       ralink,num-gpios = <16>;
                        ralink,register-map = [ 00 04 08 0c
                                                10 14 18 1c
                                                20 24 ];
                        gpio-controller;
                        #gpio-cells = <2>;
 
+                       ngpios = <32>;
                        ralink,gpio-base = <40>;
-                       ralink,num-gpios = <32>;
                        ralink,register-map = [ 00 04 08 0c
                                                10 14 18 1c
                                                20 24 ];
                        gpio-controller;
                        #gpio-cells = <2>;
 
+                       ngpios = <1>;
                        ralink,gpio-base = <72>;
-                       ralink,num-gpios = <1>;
                        ralink,register-map = [ 00 04 08 0c
                                                10 14 18 1c
                                                20 24 ];
index 309608adb13911e2b2209603d7f167f0f31349f9..2fac091898d99bdd679a65969ef0c0ccfdf02222 100644 (file)
                        gpio-controller;
                        #gpio-cells = <2>;
 
+                       ngpios = <24>;
                        ralink,gpio-base = <0>;
-                       ralink,num-gpios = <24>;
                        ralink,register-map = [ 00 04 08 0c
                                                20 24 28 2c
                                                30 34 ];
                        gpio-controller;
                        #gpio-cells = <2>;
 
+                       ngpios = <16>;
                        ralink,gpio-base = <24>;
-                       ralink,num-gpios = <16>;
                        ralink,register-map = [ 00 04 08 0c
                                                10 14 18 1c
                                                20 24 ];
                        gpio-controller;
                        #gpio-cells = <2>;
 
+                       ngpios = <32>;
                        ralink,gpio-base = <40>;
-                       ralink,num-gpios = <32>;
                        ralink,register-map = [ 00 04 08 0c
                                                10 14 18 1c
                                                20 24 ];
                        gpio-controller;
                        #gpio-cells = <2>;
 
+                       ngpios = <1>;
                        ralink,gpio-base = <72>;
-                       ralink,num-gpios = <1>;
                        ralink,register-map = [ 00 04 08 0c
                                                10 14 18 1c
                                                20 24 ];
index b02ef4f465f003bc561c65a0ae73619c80d758c9..9dd8f3c6e38b9ec0c514843732cca06a47541c07 100644 (file)
@@ -81,8 +81,8 @@
                        gpio-controller;
                        #gpio-cells = <2>;
 
+                       ngpios = <24>;
                        ralink,gpio-base = <0>;
-                       ralink,num-gpios = <24>;
                        ralink,register-map = [ 00 04 08 0c
                                                20 24 28 2c
                                                30 34 ];
@@ -95,8 +95,8 @@
                        gpio-controller;
                        #gpio-cells = <2>;
 
+                       ngpios = <16>;
                        ralink,gpio-base = <24>;
-                       ralink,num-gpios = <16>;
                        ralink,register-map = [ 00 04 08 0c
                                                10 14 18 1c
                                                20 24 ];
                        gpio-controller;
                        #gpio-cells = <2>;
 
+                       ngpios = <32>;
                        ralink,gpio-base = <40>;
-                       ralink,num-gpios = <32>;
                        ralink,register-map = [ 00 04 08 0c
                                                10 14 18 1c
                                                20 24 ];
index 9ba8a4df3609d0b2dd0337941a0b4580eb6df300..0cecd5d8cf022a5f3b3833f8efd1744d88f15f32 100644 (file)
                        gpio-controller;
                        #gpio-cells = <2>;
 
+                       ngpios = <24>;
                        ralink,gpio-base = <0>;
-                       ralink,num-gpios = <24>;
                        ralink,register-map = [ 00 04 08 0c
                                                20 24 28 2c
                                                30 34 ];
                        gpio-controller;
                        #gpio-cells = <2>;
 
+                       ngpios = <16>;
                        ralink,gpio-base = <24>;
-                       ralink,num-gpios = <16>;
                        ralink,register-map = [ 00 04 08 0c
                                                10 14 18 1c
                                                20 24 ];
                        gpio-controller;
                        #gpio-cells = <2>;
 
+                       ngpios = <12>;
                        ralink,gpio-base = <40>;
-                       ralink,num-gpios = <12>;
                        ralink,register-map = [ 00 04 08 0c
                                                10 14 18 1c
                                                20 24 ];
index 054d2e8450507bc6dbd8a2ac2e000e5cae0e032b..84d6ed5905870d7f1f62ef28e57734d7bf6cbc40 100644 (file)
                        gpio-controller;
                        #gpio-cells = <2>;
 
+                       ngpios = <24>;
                        ralink,gpio-base = <0>;
-                       ralink,num-gpios = <24>;
                        ralink,register-map = [ 00 04 08 0c
                                                20 24 28 2c
                                                30 34 ];
                        gpio-controller;
                        #gpio-cells = <2>;
 
+                       ngpios = <16>;
                        ralink,gpio-base = <24>;
-                       ralink,num-gpios = <16>;
                        ralink,register-map = [ 00 04 08 0c
                                                10 14 18 1c
                                                20 24 ];
                        gpio-controller;
                        #gpio-cells = <2>;
 
+                       ngpios = <6>;
                        ralink,gpio-base = <40>;
-                       ralink,num-gpios = <6>;
                        ralink,register-map = [ 00 04 08 0c
                                                10 14 18 1c
                                                20 24 ];
index 081b52bfd873d123f9173fbff3be90d27b85d254..158640bf925c5bc3a3c0429b1e4445fdffac67f8 100644 (file)
                        gpio-controller;
                        #gpio-cells = <2>;
 
+                       ngpios = <24>;
                        ralink,gpio-base = <0>;
-                       ralink,num-gpios = <24>;
                        ralink,register-map = [ 00 04 08 0c
                                                20 24 28 2c
                                                30 34 ];
                        gpio-controller;
                        #gpio-cells = <2>;
 
+                       ngpios = <16>;
                        ralink,gpio-base = <24>;
-                       ralink,num-gpios = <16>;
                        ralink,register-map = [ 00 04 08 0c
                                                10 14 18 1c
                                                20 24 ];
                        gpio-controller;
                        #gpio-cells = <2>;
 
+                       ngpios = <32>;
                        ralink,gpio-base = <40>;
-                       ralink,num-gpios = <32>;
                        ralink,register-map = [ 00 04 08 0c
                                                10 14 18 1c
                                                20 24 ];
                        gpio-controller;
                        #gpio-cells = <2>;
 
+                       ngpios = <24>;
                        ralink,gpio-base = <72>;
-                       ralink,num-gpios = <24>;
                        ralink,register-map = [ 00 04 08 0c
                                                10 14 18 1c
                                                20 24 ];
index 579d41456bf267713db49924052596fcfa19709f..ac4c6d9db259c428c4952f0b5b0c253df567056f 100644 (file)
                        gpio-controller;
                        #gpio-cells = <2>;
 
+                       ngpios = <22>;
                        ralink,gpio-base = <0>;
-                       ralink,num-gpios = <22>;
                        ralink,register-map = [ 00 04 08 0c
                                                20 24 28 2c
                                                30 34 ];
                        gpio-controller;
                        #gpio-cells = <2>;
 
+                       ngpios = <6>;
                        ralink,gpio-base = <22>;
-                       ralink,num-gpios = <6>;
                        ralink,register-map = [ 00 04 08 0c
                                                10 14 18 1c
                                                20 24 ];
index 7d5f98f64722d07f8b9d5927881d0e972617ae29..93dabf877626d07f24f5cbbb687bb6300efbed3e 100644 (file)
@@ -29,7 +29,7 @@ Cc: linux-gpio@vger.kernel.org
 +- reg : Physical base address and length of the controller's registers
 +- interrupt-parent: phandle to the INTC device node
 +- interrupts : Specify the INTC interrupt number
-+- ralink,num-gpios : Specify the number of GPIOs
++- ngpios : Specify the number of GPIOs
 +- ralink,register-map : The register layout depends on the GPIO bank and actual
 +              SoC type. Register offsets need to be in this order.
 +              [ INT, EDGE, RENA, FENA, DATA, DIR, POL, SET, RESET, TOGGLE ]
@@ -50,8 +50,8 @@ Cc: linux-gpio@vger.kernel.org
 +              interrupt-parent = <&intc>;
 +              interrupts = <6>;
 +
++              ngpios = <24>;
 +              ralink,gpio-base = <0>;
-+              ralink,num-gpios = <24>;
 +              ralink,register-map = [ 00 04 08 0c
 +                              20 24 28 2c
 +                              30 34 ];
index 141d29f9401ca67be8c8a80b2e094d287a6e2e8d..c173336924d26e035fce17c6d5b7329c367a0bb7 100644 (file)
@@ -357,7 +357,7 @@ Cc: linux-gpio@vger.kernel.org
 +              return -EINVAL;
 +      }
 +
-+      ngpio = of_get_property(np, "ralink,num-gpios", NULL);
++      ngpio = of_get_property(np, "ngpios", NULL);
 +      if (!ngpio) {
 +              dev_err(&pdev->dev, "failed to read number of pins\n");
 +              return -EINVAL;
diff --git a/target/linux/ramips/patches-5.10/804-staging-mt7621-pinctrl-use-ngpios-not-num-gpios.patch b/target/linux/ramips/patches-5.10/804-staging-mt7621-pinctrl-use-ngpios-not-num-gpios.patch
new file mode 100644 (file)
index 0000000..0d62bd8
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
++++ b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
+@@ -354,7 +354,7 @@ static int rt2880_pinmux_probe(struct pl
+               if (!of_device_is_available(np))
+                       continue;
+-              ngpio = of_get_property(np, "ralink,num-gpios", NULL);
++              ngpio = of_get_property(np, "ngpios", NULL);
+               gpiobase = of_get_property(np, "ralink,gpio-base", NULL);
+               if (!ngpio || !gpiobase) {
+                       dev_err(&pdev->dev, "failed to load chip info\n");
index 7d5f98f64722d07f8b9d5927881d0e972617ae29..93dabf877626d07f24f5cbbb687bb6300efbed3e 100644 (file)
@@ -29,7 +29,7 @@ Cc: linux-gpio@vger.kernel.org
 +- reg : Physical base address and length of the controller's registers
 +- interrupt-parent: phandle to the INTC device node
 +- interrupts : Specify the INTC interrupt number
-+- ralink,num-gpios : Specify the number of GPIOs
++- ngpios : Specify the number of GPIOs
 +- ralink,register-map : The register layout depends on the GPIO bank and actual
 +              SoC type. Register offsets need to be in this order.
 +              [ INT, EDGE, RENA, FENA, DATA, DIR, POL, SET, RESET, TOGGLE ]
@@ -50,8 +50,8 @@ Cc: linux-gpio@vger.kernel.org
 +              interrupt-parent = <&intc>;
 +              interrupts = <6>;
 +
++              ngpios = <24>;
 +              ralink,gpio-base = <0>;
-+              ralink,num-gpios = <24>;
 +              ralink,register-map = [ 00 04 08 0c
 +                              20 24 28 2c
 +                              30 34 ];
index eae507bcd7b608cb2dd90b0b14acd67ef57e10cf..525c1976f915a39c04345818375bb7378024ee18 100644 (file)
@@ -357,7 +357,7 @@ Cc: linux-gpio@vger.kernel.org
 +              return -EINVAL;
 +      }
 +
-+      ngpio = of_get_property(np, "ralink,num-gpios", NULL);
++      ngpio = of_get_property(np, "ngpios", NULL);
 +      if (!ngpio) {
 +              dev_err(&pdev->dev, "failed to read number of pins\n");
 +              return -EINVAL;
diff --git a/target/linux/ramips/patches-5.4/804-staging-mt7621-pinctrl-use-ngpios-not-num-gpios.patch b/target/linux/ramips/patches-5.4/804-staging-mt7621-pinctrl-use-ngpios-not-num-gpios.patch
new file mode 100644 (file)
index 0000000..0d62bd8
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
++++ b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
+@@ -354,7 +354,7 @@ static int rt2880_pinmux_probe(struct pl
+               if (!of_device_is_available(np))
+                       continue;
+-              ngpio = of_get_property(np, "ralink,num-gpios", NULL);
++              ngpio = of_get_property(np, "ngpios", NULL);
+               gpiobase = of_get_property(np, "ralink,gpio-base", NULL);
+               if (!ngpio || !gpiobase) {
+                       dev_err(&pdev->dev, "failed to load chip info\n");