summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorIoana Ciornei <ioana.ciornei@nxp.com>2025-10-14 18:53:53 +0300
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>2025-10-22 09:52:17 +0300
commit00aaae60faf554c27c95e93d47f200a93ff266ef (patch)
tree982d7fc3dd747b844accbae21e59eff576d541dd /include
parentd37623132a6347b4ab9e2179eb3f2fa77863c364 (diff)
downloadlinux-00aaae60faf554c27c95e93d47f200a93ff266ef.tar.xz
gpio: regmap: add the .fixed_direction_output configuration parameter
There are GPIO controllers such as the one present in the LX2160ARDB QIXIS FPGA which have fixed-direction input and output GPIO lines mixed together in a single register. This cannot be modeled using the gpio-regmap as-is since there is no way to present the true direction of a GPIO line. In order to make this use case possible, add a new configuration parameter - fixed_direction_output - into the gpio_regmap_config structure. This will enable user drivers to provide a bitmap that represents the fixed direction of the GPIO lines. Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com> Acked-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Reviewed-by: Michael Walle <mwalle@kernel.org> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/gpio/regmap.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/gpio/regmap.h b/include/linux/gpio/regmap.h
index 622a2939ebe0..87983a5f3681 100644
--- a/include/linux/gpio/regmap.h
+++ b/include/linux/gpio/regmap.h
@@ -38,6 +38,10 @@ struct regmap;
* offset to a register/bitmask pair. If not
* given the default gpio_regmap_simple_xlate()
* is used.
+ * @fixed_direction_output:
+ * (Optional) Bitmap representing the fixed direction of
+ * the GPIO lines. Useful when there are GPIO lines with a
+ * fixed direction mixed together in the same register.
* @drvdata: (Optional) Pointer to driver specific data which is
* not used by gpio-remap but is provided "as is" to the
* driver callback(s).
@@ -85,6 +89,7 @@ struct gpio_regmap_config {
int reg_stride;
int ngpio_per_reg;
struct irq_domain *irq_domain;
+ unsigned long *fixed_direction_output;
#ifdef CONFIG_REGMAP_IRQ
struct regmap_irq_chip *regmap_irq_chip;