Re: [PATCH v2 0/2] gpio: realtek-otto: make the driver work with SWAP_IO_SPACE
From: Andy Shevchenko
Date: Mon Sep 28 2026 - 05:53:36 EST
On Sat, Aug 15, 2026 at 02:44:49PM +0500, Rustam Adilov wrote:
> This patch series changes gpio-realtek-otto to be functional around
> SWAP_IO_SPACE config.
>
> Firstly the ioread32 and iowrite32 in realtek_gpio_update_line_imr()
> have to be changed to their __raw variants as it is the only point in
> the driver where both devices with ports reversed and without meet.
>
> Secondly, the bank_read/write and the flag for generic gpio config
> have to be able to be changed to the opposite one when SWAP_IO_SPACE
> is enabled. To avoid breaking any existing device tree out in the wild,
> make them overridable by endian properties from the device tree node and
> keep the current GPIO_PORTS_REVERSED quirk as it is.
>
> I have tested it on my RTL9607C machine with SWAP_IO_SPACE enabled
> and with big-endian property set under gpio controller node and it
> was working fine.
Convert the driver to use regmap MMIO and most of the code in this series won't
be needed. Also it will give some benefits (like register caching and debugfs
monitoring).
--
With Best Regards,
Andy Shevchenko