[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250107102735.317446-2-noltari@gmail.com>
Date: Tue, 7 Jan 2025 11:27:34 +0100
From: Álvaro Fernández Rojas <noltari@...il.com>
To: jonas.gorski@...il.com,
kylehendrydev@...il.com,
florian.fainelli@...adcom.com,
linus.walleij@...aro.org,
bcm-kernel-feedback-list@...adcom.com,
linux-gpio@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: Álvaro Fernández Rojas <noltari@...il.com>
Subject: [PATCH 1/2] gpio: regmap: add request/free gpio_chip functions
Allow configuring gpio_chip request/free functions when creating a gpio-regmap.
Signed-off-by: Álvaro Fernández Rojas <noltari@...il.com>
---
drivers/gpio/gpio-regmap.c | 2 ++
include/linux/gpio/regmap.h | 4 ++++
2 files changed, 6 insertions(+)
diff --git a/drivers/gpio/gpio-regmap.c b/drivers/gpio/gpio-regmap.c
index 71684dee2ca5..32ec85b41653 100644
--- a/drivers/gpio/gpio-regmap.c
+++ b/drivers/gpio/gpio-regmap.c
@@ -261,6 +261,8 @@ struct gpio_regmap *gpio_regmap_register(const struct gpio_regmap_config *config
chip->names = config->names;
chip->label = config->label ?: dev_name(config->parent);
chip->can_sleep = regmap_might_sleep(config->regmap);
+ chip->request = config->request;
+ chip->free = config->free;
chip->get = gpio_regmap_get;
if (gpio->reg_set_base && gpio->reg_clr_base)
diff --git a/include/linux/gpio/regmap.h b/include/linux/gpio/regmap.h
index a9f7b7faf57b..cd4ea9661eea 100644
--- a/include/linux/gpio/regmap.h
+++ b/include/linux/gpio/regmap.h
@@ -5,6 +5,7 @@
struct device;
struct fwnode_handle;
+struct gpio_chip;
struct gpio_regmap;
struct irq_domain;
struct regmap;
@@ -82,6 +83,9 @@ struct gpio_regmap_config {
unsigned int offset, unsigned int *reg,
unsigned int *mask);
+ int (*request)(struct gpio_chip *chip, unsigned int offset);
+ void (*free)(struct gpio_chip *chip, unsigned int offset);
+
void *drvdata;
};
--
2.39.5
Powered by blists - more mailing lists