Re: [PATCH v3 2/2] gpio: Add Realtek Otto GPIO support

2021-03-24 Thread Sander Vanheule
On Wed, 2021-03-24 at 22:22 +0100, Sander Vanheule wrote: > +static inline u8 read_u8_reg(void __iomem* reg, unsigned int port) > +{ > +   return ioread8(reg + port); > +} > + > +static inline void write_u8_reg(void __iomem* reg, unsigned int port, > u8 value) > +{ > +   iowrite8(value, reg

[PATCH v3 2/2] gpio: Add Realtek Otto GPIO support

2021-03-24 Thread Sander Vanheule
Realtek MIPS SoCs (platform name Otto) have GPIO controllers with up to 64 GPIOs, divided over two banks. Each bank has a set of registers for 32 GPIOs, with support for edge-triggered interrupts. Each GPIO bank consists of four 8-bit GPIO ports (ABCD and EFGH). Most registers pack one bit per GPI