* [PATCH v2 1/2] dt-bindings: gpio: realtek-otto: Add RTL9311B
2026-11-09 5:28 [PATCH v2 0/2] gpio: realtek-otto: Add RTL9311B support Joshua Scott
@ 2026-11-09 5:28 ` Joshua Scott
2026-11-10 11:44 ` Krzysztof Kozlowski
2026-11-09 5:28 ` [PATCH v2 2/2] gpio: realtek-otto: Allow building for the RTL9311B Joshua Scott
1 sibling, 1 reply; 4+ messages in thread
From: Joshua Scott @ 2026-11-09 5:28 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski, linux-gpio
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, devicetree,
Sander Vanheule, Bert Vermeulen, linux-kernel, Joshua Scott
The Realtek RTL9311B is a network switch with integrated ARMv8 CPU. It
has the same GPIO controller as the RTL9310, with one bank of 20 GPIOs.
Add a compatible for it, with the RTL9310 compatible as a fallback.
Signed-off-by: Joshua Scott <joshua.scott@alliedtelesis.co.nz>
---
Changes in v2:
- Add the RTL9311B as its own compatible list, with "realtek,rtl9310-gpio"
as a fallback, instead of adding it to the enum used with
"realtek,otto-gpio" alone
.../bindings/gpio/realtek,otto-gpio.yaml | 22 ++++++++++++-------
1 file changed, 14 insertions(+), 8 deletions(-)
diff --git a/Documentation/devicetree/bindings/gpio/realtek,otto-gpio.yaml b/Documentation/devicetree/bindings/gpio/realtek,otto-gpio.yaml
index 33c25df7b815..a337345a1e90 100644
--- a/Documentation/devicetree/bindings/gpio/realtek,otto-gpio.yaml
+++ b/Documentation/devicetree/bindings/gpio/realtek,otto-gpio.yaml
@@ -15,6 +15,7 @@ description: |
of two banks of 32 GPIOs. These GPIOs can generate edge-triggered interrupts.
Each bank's interrupts are cascased into one interrupt line on the parent
interrupt controller, if provided.
+ The Arm-based RTL9311B has the same controller, with one bank.
This binding allows defining a single bank in the devicetree. The interrupt
controller is not supported on the fallback compatible name, which only
allows for GPIO port use.
@@ -24,14 +25,19 @@ properties:
pattern: "^gpio@[0-9a-f]+$"
compatible:
- items:
- - enum:
- - realtek,rtl8380-gpio
- - realtek,rtl8390-gpio
- - realtek,rtl9300-gpio
- - realtek,rtl9310-gpio
- - realtek,rtl9607-gpio
- - const: realtek,otto-gpio
+ oneOf:
+ - items:
+ - enum:
+ - realtek,rtl8380-gpio
+ - realtek,rtl8390-gpio
+ - realtek,rtl9300-gpio
+ - realtek,rtl9310-gpio
+ - realtek,rtl9607-gpio
+ - const: realtek,otto-gpio
+ - items:
+ - const: realtek,rtl9311b-gpio
+ - const: realtek,rtl9310-gpio
+ - const: realtek,otto-gpio
reg: true
--
2.53.0
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH v2 2/2] gpio: realtek-otto: Allow building for the RTL9311B
2026-11-09 5:28 [PATCH v2 0/2] gpio: realtek-otto: Add RTL9311B support Joshua Scott
2026-11-09 5:28 ` [PATCH v2 1/2] dt-bindings: gpio: realtek-otto: Add RTL9311B Joshua Scott
@ 2026-11-09 5:28 ` Joshua Scott
1 sibling, 0 replies; 4+ messages in thread
From: Joshua Scott @ 2026-11-09 5:28 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski, linux-gpio
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, devicetree,
Sander Vanheule, Bert Vermeulen, linux-kernel, Joshua Scott
The Realtek RTL9311B is a network switch with integrated ARMv8 CPU. It
has the same GPIO controller as the RTL9310. Allow the driver to be
built for ARCH_REALTEK.
Signed-off-by: Joshua Scott <joshua.scott@alliedtelesis.co.nz>
---
Changes in v2:
- Drop the "realtek,rtl9311b-gpio" match entry, as the RTL9311B now
binds through "realtek,rtl9310-gpio" (Krzysztof)
- Retitle from "gpio: realtek-otto: Add RTL9311B support", as only the
Kconfig change remains
drivers/gpio/Kconfig | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
index 55e4280029d8..bc584da1abbb 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -645,14 +645,15 @@ config GPIO_RDA
config GPIO_REALTEK_OTTO
tristate "Realtek Otto GPIO support"
- depends on MACH_REALTEK_RTL || COMPILE_TEST
+ depends on MACH_REALTEK_RTL || ARCH_REALTEK || COMPILE_TEST
default MACH_REALTEK_RTL
select GPIO_GENERIC
select GPIOLIB_IRQCHIP
help
The GPIO controller on the Otto MIPS platform supports up to two
banks of 32 GPIOs, with edge triggered interrupts. The 32 GPIOs
- are grouped in four 8-bit wide ports.
+ are grouped in four 8-bit wide ports. The Arm-based RTL9311B has
+ the same controller.
When built as a module, the module will be called realtek_otto_gpio.
--
2.53.0
^ permalink raw reply [flat|nested] 4+ messages in thread