[PATCH 0/2] gpio: realtek-otto: make the driver work with SWAP_IO_SPACE

Rustam Adilov posted 2 patches 2 weeks, 1 day ago
drivers/gpio/gpio-realtek-otto.c | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
[PATCH 0/2] gpio: realtek-otto: make the driver work with SWAP_IO_SPACE
Posted by Rustam Adilov 2 weeks, 1 day ago
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 separated from GPIO_PORTS_REVERSED as they have to be
changed to the opposite one when SWAP_IO_SPACE is enabled. The
device_is_big_endian() function seem to be a good choice for it.
That does mean the rtl838x, rtl839x and rtl931x has to add
big-endian property to their gpio controller nodes for gpio to be
operational without SWAP_IO_SPACE.

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.

Rustam Adilov (2):
  gpio: realtek-otto: use __raw_readl/writel in
    realtek_gpio_update_line_imr()
  gpio: realtek-otto: decide bank_read/write by device endianness

 drivers/gpio/gpio-realtek-otto.c | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

-- 
2.55.0