Re: [RFC PATCH 2/5] gpio: generic: extend gpio_generic_chip_config with PMIO register fields
From: Linus Walleij
Date: Thu Apr 09 2026 - 04:04:22 EST
Hi Jose,
thanks for your patch!
On Tue, Apr 7, 2026 at 8:49 PM Jose Javier Rodriguez Barbarin
<dev-josejavier.rodriguez@xxxxxxxxxx> wrote:
> Instead of replacing the register type with gpio_chip_reg, it is better
> to extend the structure by adding dedicated fields for I/O port
> registers.
>
> This ensures compatibility with memory-mapped devices.
>
> Signed-off-by: Jose Javier Rodriguez Barbarin <dev-josejavier.rodriguez@xxxxxxxxxx>
(...)
> @@ -54,6 +59,11 @@ struct gpio_generic_chip_config {
> void __iomem *clr;
> void __iomem *dirout;
> void __iomem *dirin;
> + unsigned long dat_port;
> + unsigned long set_port;
> + unsigned long clr_port;
> + unsigned long dirout_port;
> + unsigned long dirin_port;
Isn't it easier to just create a new config type?
struct gpio_generic_port_chip_config { ... }?
It's only three more entries apart from this that will be duplicate.
This is only used during config anyway so it should be fine I think.
Yours,
Linus Walleij