realtek: rtl838x: add gpio-ranges for pinctrl realtek/mfd-swcore
authorSander Vanheule <sander@svanheule.net>
Fri, 30 Sep 2022 21:41:45 +0000 (23:41 +0200)
committerSander Vanheule <sander@svanheule.net>
Mon, 31 Oct 2022 17:52:43 +0000 (18:52 +0100)
For completeness, add the (known) GPIO pin mappings to the pinctrl node,
indicating the positions of these pins on the SoC package.

For 5.10 kernels, this results in a warning during boot:

    gpiochip_add_data_with_key: GPIOs 488..511 (18003500.gpio-controller) failed to register, -517

This warning is due to the GPIO driver returning -EPROBEDEFER, as the
pinctrl driver hasn't loaded yet. The driver will correctly load at some
later point, and the warning is quelled on later kernel versions.

Signed-off-by: Sander Vanheule <sander@svanheule.net>
target/linux/realtek/dts-5.10/rtl838x.dtsi

index f1c5ae6a3f22bb2dfa54ae1822fcb817d91e99df..483ff72c904b918fc3153bea8d3a22abbfbb0973 100644 (file)
                        #gpio-cells = <2>;
                        ngpios = <24>;
 
+                       gpio-ranges = <&pinctrl 0 113 1>,
+                               <&pinctrl 2 111 1>,
+                               <&pinctrl 3 110 1>,
+                               <&pinctrl 10 30 2>,
+                               <&pinctrl 12 29 1>,
+                               <&pinctrl 13 28 1>,
+                               <&pinctrl 14 32 1>;
+
                        interrupt-controller;
                        #interrupt-cells = <2>;
                        interrupt-parent = <&intc>;
                        status = "disabled";
                };
 
-               pinctrl {
+               pinctrl: pinctrl {
                        compatible = "realtek,maple-pinctrl";
 
                        pinmux_disable_sys_led: pinmux-sys-led-gpio {