summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorMathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>2025-08-24 13:57:25 +0200
committerLee Jones <lee@kernel.org>2025-09-16 15:24:48 +0100
commit0627b71fa5508ab605b6e9fd74baed40805cfdda (patch)
treeb1320069c6a180bb32477b86fbf45067a8ba33be /include/linux
parent553b75d4bfe9264f631d459fe9996744e0672b0e (diff)
gpio: regmap: Allow to provide init_valid_mask callback
Allows to populate the gpio_regmap_config structure with init_valid_mask() callback to set on the final gpio_chip structure. Reviewed-by: Michael Walle <mwalle@kernel.org> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Link: https://lore.kernel.org/r/20250824-mdb-max7360-support-v14-6-435cfda2b1ea@bootlin.com Signed-off-by: Lee Jones <lee@kernel.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/gpio/regmap.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/gpio/regmap.h b/include/linux/gpio/regmap.h
index 19b52ac03a5d..622a2939ebe0 100644
--- a/include/linux/gpio/regmap.h
+++ b/include/linux/gpio/regmap.h
@@ -6,6 +6,7 @@
struct device;
struct fwnode_handle;
struct gpio_regmap;
+struct gpio_chip;
struct irq_domain;
struct regmap;
@@ -40,6 +41,8 @@ struct regmap;
* @drvdata: (Optional) Pointer to driver specific data which is
* not used by gpio-remap but is provided "as is" to the
* driver callback(s).
+ * @init_valid_mask: (Optional) Routine to initialize @valid_mask, to be used
+ * if not all GPIOs are valid.
* @regmap_irq_chip: (Optional) Pointer on an regmap_irq_chip structure. If
* set, a regmap-irq device will be created and the IRQ
* domain will be set accordingly.
@@ -93,6 +96,10 @@ struct gpio_regmap_config {
unsigned int offset, unsigned int *reg,
unsigned int *mask);
+ int (*init_valid_mask)(struct gpio_chip *gc,
+ unsigned long *valid_mask,
+ unsigned int ngpios);
+
void *drvdata;
};