Linux GPIO subsystem development
 help / color / mirror / Atom feed
* [PATCH 0/2] gpio: realtek-otto: make the driver work with SWAP_IO_SPACE
@ 2026-07-10 18:34 Rustam Adilov
  2026-07-10 18:34 ` [PATCH 1/2] gpio: realtek-otto: use __raw_readl/writel in realtek_gpio_update_line_imr() Rustam Adilov
  2026-07-10 18:34 ` [PATCH 2/2] gpio: realtek-otto: decide bank_read/write by device endianness Rustam Adilov
  0 siblings, 2 replies; 5+ messages in thread
From: Rustam Adilov @ 2026-07-10 18:34 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Sander Vanheule, linux-gpio,
	linux-kernel
  Cc: Rustam Adilov

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-07-15 19:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-10 18:34 [PATCH 0/2] gpio: realtek-otto: make the driver work with SWAP_IO_SPACE Rustam Adilov
2026-07-10 18:34 ` [PATCH 1/2] gpio: realtek-otto: use __raw_readl/writel in realtek_gpio_update_line_imr() Rustam Adilov
2026-07-10 18:34 ` [PATCH 2/2] gpio: realtek-otto: decide bank_read/write by device endianness Rustam Adilov
2026-07-15  9:39   ` Bartosz Golaszewski
2026-07-15 19:00     ` Rustam Adilov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox