Skip to contentSkip to conversation

support for RTL9607C GPIO Controller

PATCH Applied Rustam Adilov 4 participants 10 messages Mar 5 – Mar 10

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover support for RTL9607C GPIO Controller

This patch series adds support for the GPIO controller found in RTL9607C SoC family of MIPS CPUs.

The GPIO controller on this SoC has a reversed port order, the same as in RTL930x but without CPU affinity settings.

Rustam Adilov (2):
dt-bindings: gpio: realtek-otto: add rtl9607 compatible
gpio: realtek-otto: add rtl9607 support

 Documentation/devicetree/bindings/gpio/realtek,otto-gpio.yaml | 1 +
 drivers/gpio/gpio-realtek-otto.c                              | 4 ++++
 2 files changed, 5 insertions(+)
Signature · 1 line
2.53.0
#1 lore raw

PATCH 1/2 dt-bindings: gpio: realtek-otto: add rtl9607 compatible

Add the "realtek,rtl9607-gpio" compatible for GPIO nodes on the RTL9607C SoC series.

---
 Documentation/devicetree/bindings/gpio/realtek,otto-gpio.yaml | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/gpio/realtek,otto-gpio.yaml +1 -0
index 728099c65824..b18f8f0ca0ae 100644
@@ -30,6 +30,7 @@ properties:
           - realtek,rtl8390-gpio
           - realtek,rtl9300-gpio
           - realtek,rtl9310-gpio
+          - realtek,rtl9607-gpio
       - const: realtek,otto-gpio
 
   reg: true
Signature · 1 line
2.53.0
Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] dt-bindings: gpio: realtek-otto: add rtl9607 compatible

Quoted 14 lines · Rustam Adilov

Add the "realtek,rtl9607-gpio" compatible for GPIO nodes on the RTL9607C SoC series.

---
 Documentation/devicetree/bindings/gpio/realtek,otto-gpio.yaml | 1 +

 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/gpio/realtek,otto-gpio.yaml +0 -0
index 728099c65824..b18f8f0ca0ae 100644
@@ -30,6 +30,7 @@ properties:
Quoted 7 lines

           - realtek,rtl8390-gpio
           - realtek,rtl9300-gpio
           - realtek,rtl9310-gpio
+          - realtek,rtl9607-gpio
       - const: realtek,otto-gpio

   reg: true

Best,
Sander

#4 lore raw

PATCH 2/2 gpio: realtek-otto: add rtl9607 support

In reply to Rustam Adilov

The RTL9607C SoC has support for 3 GPIO banks with 32 GPIOs each and the port order is reversed just like in RTL930x.

---
 drivers/gpio/gpio-realtek-otto.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpio/gpio-realtek-otto.c +4 -0
index 4cf91528f547..5e3152c2e51a 100644
@@ -351,6 +351,10 @@ static const struct of_device_id realtek_gpio_of_match[] = {
 	{
 		.compatible = "realtek,rtl9310-gpio",
 	},
+	{
+		.compatible = "realtek,rtl9607-gpio",
+		.data = (void *)GPIO_PORTS_REVERSED,
+	},
 	{}
 };
 MODULE_DEVICE_TABLE(of, realtek_gpio_of_match);
Signature · 1 line
2.53.0
#5 lore raw

Re: [PATCH 2/2] gpio: realtek-otto: add rtl9607 support

Hi,

Quoted 24 lines · Rustam Adilov

The RTL9607C SoC has support for 3 GPIO banks with 32 GPIOs each and the port order is reversed just like in RTL930x.

---
 drivers/gpio/gpio-realtek-otto.c | 4 ++++

 1 file changed, 4 insertions(+)
drivers/gpio/gpio-realtek- renamed from drivers/gpio/gpio-realtek-otto.c +0 -0

otto.c
index 4cf91528f547..5e3152c2e51a 100644

drivers/gpio/gpio-realtek-otto.c +4 -0
@@ -351,6 +351,10 @@ static const struct of_device_id realtek_gpio_of_match[]
 = {
  	{
  		.compatible = "realtek,rtl9310-gpio",
  	},
+	{
+		.compatible = "realtek,rtl9607-gpio",
+		.data = (void *)GPIO_PORTS_REVERSED,
+	},
  	{}
  };
Quoted 1 line

 MODULE_DEVICE_TABLE(of, realtek_gpio_of_match);

If I'm not mistaken, this SoC has a MIPS InterAptiv CPU like the RTL931x SoC series. Were you able to validate that the interrupts are functioning as expected?

Best,
Sander

author
#6 lore raw

Re: [PATCH 2/2] gpio: realtek-otto: add rtl9607 support

Quoted 34 lines · Sander Vanheule

Hi,

Quoted 23 lines · Rustam Adilov

The RTL9607C SoC has support for 3 GPIO banks with 32 GPIOs each and the port order is reversed just like in RTL930x.

---
 drivers/gpio/gpio-realtek-otto.c | 4 ++++

 1 file changed, 4 insertions(+)
drivers/gpio/gpio-realtek- renamed from drivers/gpio/gpio-realtek-otto.c +0 -0

otto.c
index 4cf91528f547..5e3152c2e51a 100644

drivers/gpio/gpio-realtek-otto.c +0 -0
@@ -351,6 +351,10 @@ static const struct of_device_id 

realtek_gpio_of_match[]
= {
  {
  .compatible = "realtek,rtl9310-gpio", },

drivers/gpio/gpio-realtek-otto.c +4 -0
+	{
+		.compatible = "realtek,rtl9607-gpio",
+		.data = (void *)GPIO_PORTS_REVERSED,
+	},
Quoted 3 lines

  {}
 };
 MODULE_DEVICE_TABLE(of, realtek_gpio_of_match);

If I'm not mistaken, this SoC has a MIPS InterAptiv CPU like the RTL931x SoC series. Were you able to validate that the interrupts are functioning as expected?

Quoted 2 lines

Best,
Sander

Hi Sander,

Yes, this is correct. I played around with gpio-keys in OpenWrt (though it has its own gpio-button-hotplug but it should not change things) and can verify that button presses and releases are working. I think this should confirm that interrupts are functional.

Reviewed-by
#7 lore raw

Re: [PATCH 2/2] gpio: realtek-otto: add rtl9607 support

Hi,

Quoted 15 lines · adilov
Quoted 11 lines · Sander Vanheule

On Thu, 2026-03-05 at 21:11 +0500, Rustam Adilov wrote:,

drivers/gpio/gpio-realtek-otto.c static const struct of_device_id realtek_gpio_of_match[] = { · line 357

Quoted 4 lines
drivers/gpio/gpio-realtek-otto.c +4 -0
+	{
+		.compatible = "realtek,rtl9607-gpio",
+		.data = (void *)GPIO_PORTS_REVERSED,
+	},

If I'm not mistaken, this SoC has a MIPS InterAptiv CPU like the RTL931x SoC
series. Were you able to validate that the interrupts are functioning as
expected?

Quoted 2 lines

Best,
Sander

Quoted 7 lines

Hi Sander,

Yes, this is correct. I played around with gpio-keys in OpenWrt (though it
has its own gpio-button-hotplug but it should not change things) and can verify that button presses and releases are working. I think this should confirm that interrupts are functional.

Thanks for the info. I was mainly wondering because there seemed to be some initial confusion [1] about the port order. If you get the order wrong, you would be getting spurious interrupts.

[1] https://forum.openwrt.org/t/240741/25

If the order is correct, you should see the key GPIO interrupt increase in /proc/interrupts. So, assuming that's the case:

Best,
Sander

#8 lore raw

Re: [PATCH 2/2] gpio: realtek-otto: add rtl9607 support

Quoted 32 lines · Sander Vanheule

Hi,

Quoted 15 lines · adilov
Quoted 11 lines · Sander Vanheule

On Thu, 2026-03-05 at 21:11 +0500, Rustam Adilov wrote:,

drivers/gpio/gpio-realtek-otto.c static const struct of_device_id realtek_gpio_of_match[] = { · line 357

Quoted 4 lines
drivers/gpio/gpio-realtek-otto.c +4 -0
+	{
+		.compatible = "realtek,rtl9607-gpio",
+		.data = (void *)GPIO_PORTS_REVERSED,
+	},

If I'm not mistaken, this SoC has a MIPS InterAptiv CPU like the RTL931x SoC
series. Were you able to validate that the interrupts are functioning as
expected?

Quoted 2 lines

Best,
Sander

Quoted 7 lines

Hi Sander,

Yes, this is correct. I played around with gpio-keys in OpenWrt (though it
has its own gpio-button-hotplug but it should not change things) and can verify that button presses and releases are working. I think this should confirm that interrupts are functional.

Thanks for the info. I was mainly wondering because there seemed to be some initial confusion [1] about the port order. If you get the order wrong, you would be getting spurious interrupts.

[1] https://forum.openwrt.org/t/240741/25

Quoted 7 lines

If the order is correct, you should see the key GPIO interrupt increase in /proc/interrupts. So, assuming that's the case:

Best,
Sander

Thankfully i had saved the testing image so i quickly booted up my board and yes, i can see that interrupts increase in /proc/interrupts.

Before button press:
CPU0 CPU1 CPU2 CPU3
....

 27:          0          0          0          0  realtek-otto-gpio   5  keys
 28:          0          0          0          0  realtek-otto-gpio   2  keys
 29:          0          0          0          0  realtek-otto-gpio   4  keys

After the button press:

 27:          0          0          0          0  realtek-otto-gpio   5  keys
 28:          2          0          0          0  realtek-otto-gpio   2  keys
 29:          0          0          0          0  realtek-otto-gpio   4  keys

It did increase by 2 which i pressume is from press and release actions.

Thank you for the review.

Best,
Rustam

#9 lore raw
In reply to Rustam Adilov
Quoted 11 lines · Rustam Adilov

This patch series adds support for the GPIO controller found in RTL9607C SoC family of MIPS CPUs.

The GPIO controller on this SoC has a reversed port order, the same as in RTL930x but without CPU affinity settings.

Rustam Adilov (2):
dt-bindings: gpio: realtek-otto: add rtl9607 compatible
gpio: realtek-otto: add rtl9607 support

[...]

Applied, thanks!

[1/2] dt-bindings: gpio: realtek-otto: add rtl9607 compatible

      https://git.kernel.org/brgl/c/49944d6ab7eb951f2aefee69341c623e13434863
[2/2] gpio: realtek-otto: add rtl9607 support
      https://git.kernel.org/brgl/c/8f0aecf2957e7dba78603544368846133bf6d22e

Best regards,

Signature · 1 line
Bartosz Golaszewski <[email protected]>