]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
realtek: gpio: backport rtl9607c gpio support patches 22358/head
authorRustam Adilov <adilov@tutamail.com>
Tue, 10 Mar 2026 17:07:18 +0000 (22:07 +0500)
committerRobert Marko <robimarko@gmail.com>
Sun, 22 Mar 2026 16:51:34 +0000 (17:51 +0100)
This commit backports 2 patches that add gpio controller support
to RTL9607C SoCs. It enables us to make use of anything that
can be controlled by GPIO on RTL9607C, like LEDs, buttons and such.

Signed-off-by: Rustam Adilov <adilov@tutamail.com>
Link: https://github.com/openwrt/openwrt/pull/22358
Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/realtek/patches-6.12/023-01-v7.0-dt-bindings-gpio-realtek-otto-add-rtl9607-compatible.patch [new file with mode: 0644]
target/linux/realtek/patches-6.12/023-02-v7.0-gpio-realtek-otto-add-rtl9607-support.patch [new file with mode: 0644]

diff --git a/target/linux/realtek/patches-6.12/023-01-v7.0-dt-bindings-gpio-realtek-otto-add-rtl9607-compatible.patch b/target/linux/realtek/patches-6.12/023-01-v7.0-dt-bindings-gpio-realtek-otto-add-rtl9607-compatible.patch
new file mode 100644 (file)
index 0000000..bfaf092
--- /dev/null
@@ -0,0 +1,27 @@
+From 49944d6ab7eb951f2aefee69341c623e13434863 Mon Sep 17 00:00:00 2001
+From: Rustam Adilov <adilov@disroot.org>
+Date: Thu, 5 Mar 2026 21:11:05 +0500
+Subject: dt-bindings: gpio: realtek-otto: add rtl9607 compatible
+
+Add the "realtek,rtl9607-gpio" compatible for GPIO nodes
+on the RTL9607C SoC series.
+
+Signed-off-by: Rustam Adilov <adilov@disroot.org>
+Reviewed-by: Linus Walleij <linusw@kernel.org>
+Reviewed-by: Sander Vanheule <sander@svanheule.net>
+Link: https://patch.msgid.link/20260305161106.15999-2-adilov@disroot.org
+Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
+---
+ Documentation/devicetree/bindings/gpio/realtek,otto-gpio.yaml | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/Documentation/devicetree/bindings/gpio/realtek,otto-gpio.yaml
++++ b/Documentation/devicetree/bindings/gpio/realtek,otto-gpio.yaml
+@@ -30,6 +30,7 @@ properties:
+           - realtek,rtl8390-gpio
+           - realtek,rtl9300-gpio
+           - realtek,rtl9310-gpio
++          - realtek,rtl9607-gpio
+       - const: realtek,otto-gpio
+   reg: true
diff --git a/target/linux/realtek/patches-6.12/023-02-v7.0-gpio-realtek-otto-add-rtl9607-support.patch b/target/linux/realtek/patches-6.12/023-02-v7.0-gpio-realtek-otto-add-rtl9607-support.patch
new file mode 100644 (file)
index 0000000..bc60d88
--- /dev/null
@@ -0,0 +1,29 @@
+From 8f0aecf2957e7dba78603544368846133bf6d22e Mon Sep 17 00:00:00 2001
+From: Rustam Adilov <adilov@disroot.org>
+Date: Thu, 5 Mar 2026 21:11:06 +0500
+Subject: gpio: realtek-otto: add rtl9607 support
+
+The RTL9607C SoC has support for 3 GPIO banks with 32 GPIOs each and
+the port order is reversed just like in RTL930x.
+
+Signed-off-by: Rustam Adilov <adilov@disroot.org>
+Reviewed-by: Sander Vanheule <sander@svanheule.net>
+Link: https://patch.msgid.link/20260305161106.15999-3-adilov@disroot.org
+Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
+---
+ drivers/gpio/gpio-realtek-otto.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/drivers/gpio/gpio-realtek-otto.c
++++ b/drivers/gpio/gpio-realtek-otto.c
+@@ -350,6 +350,10 @@ static const struct of_device_id realtek
+       {
+               .compatible = "realtek,rtl9310-gpio",
+       },
++      {
++              .compatible = "realtek,rtl9607-gpio",
++              .data = (void *)GPIO_PORTS_REVERSED,
++      },
+       {}
+ };
+ MODULE_DEVICE_TABLE(of, realtek_gpio_of_match);