Re: [PATCH 2/2] gpio: realtek-otto: Add RTL9311B support
From: Krzysztof Kozlowski
Date: Fri Nov 06 2026 - 08:04:15 EST
On Wed, Nov 04, 2026 at 10:53:16AM +1300, Joshua Scott wrote:
> The Arm-based RTL9311B switch SoC has the same GPIO controller as the
> RTL9310, with port A in the most significant byte of each register and
> the same IMR layout. Add its compatible and allow the driver to be
> built for ARCH_REALTEK.
>
> Signed-off-by: Joshua Scott <joshua.scott@xxxxxxxxxxxxxxxxxxx>
> ---
> drivers/gpio/Kconfig | 5 +++--
> drivers/gpio/gpio-realtek-otto.c | 3 +++
> 2 files changed, 6 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.
>
> diff --git a/drivers/gpio/gpio-realtek-otto.c b/drivers/gpio/gpio-realtek-otto.c
> index 5d98ad597d9e..a4f010a0d2cf 100644
> --- a/drivers/gpio/gpio-realtek-otto.c
> +++ b/drivers/gpio/gpio-realtek-otto.c
> @@ -352,6 +352,9 @@ static const struct of_device_id realtek_gpio_of_match[] = {
> {
> .compatible = "realtek,rtl9310-gpio",
> },
> + {
> + .compatible = "realtek,rtl9311b-gpio",
Why do you need to add it if it is fully compatible?
Best regards,
Krzysztof