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>
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 ];
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 ];
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 = <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 ];
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 ];
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 ];
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 ];
+- 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 ]
+ 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 ];
+ 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;
--- /dev/null
+--- 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");
+- 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 ]
+ 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 ];
+ 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;
--- /dev/null
+--- 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");