[RFC PATCH 2/5] gpio: generic: extend gpio_generic_chip_config with PMIO register fields

From: Jose Javier Rodriguez Barbarin

Date: Tue Apr 07 2026 - 14:50:44 EST


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>
---
include/linux/gpio/generic.h | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/include/linux/gpio/generic.h b/include/linux/gpio/generic.h
index 87c624070901..9a71a8fbe56e 100644
--- a/include/linux/gpio/generic.h
+++ b/include/linux/gpio/generic.h
@@ -43,6 +43,11 @@ struct device;
* assumed that setting a line to 1 in this register will turn that
* line into an input line. Conversely, setting the line to 0 will
* turn that line into an output.
+ * @dat_port: Port-mapped counterpart of @dat.
+ * @set_port: Port-mapped counterpart of @set.
+ * @clr_port: Port-mapped counterpart of @clr.
+ * @dirout_port: Port-mapped counterpart of @dirout.
+ * @dirin_port: Port-mapped counterpart of @dirin.
* @flags: Different flags that will affect the behaviour of the device, such
* as endianness etc.
*/
@@ -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;
unsigned long flags;
};

--
2.53.0