[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250416-aaeon-up-board-pinctrl-support-v3-9-f40776bd06ee@bootlin.com>
Date: Wed, 16 Apr 2025 16:08:17 +0200
From: Thomas Richard <thomas.richard@...tlin.com>
To: Linus Walleij <linus.walleij@...aro.org>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Bartosz Golaszewski <brgl@...ev.pl>,
Geert Uytterhoeven <geert+renesas@...der.be>
Cc: linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org,
thomas.petazzoni@...tlin.com, DanieleCleri@...on.eu, GaryWang@...on.com.tw,
Thomas Richard <thomas.richard@...tlin.com>
Subject: [PATCH v3 09/10] gpio: aggregator: add possibility to attach data
to the forwarder
Add a data pointer to store private data in the forwarder.
Signed-off-by: Thomas Richard <thomas.richard@...tlin.com>
---
drivers/gpio/gpio-aggregator.c | 6 ++++--
include/linux/gpio/forwarder.h | 3 ++-
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/gpio/gpio-aggregator.c b/drivers/gpio/gpio-aggregator.c
index 0fb890f0793d..9e27ea3f78ec 100644
--- a/drivers/gpio/gpio-aggregator.c
+++ b/drivers/gpio/gpio-aggregator.c
@@ -564,7 +564,7 @@ int gpio_fwd_add_gpio_desc(struct gpiochip_fwd *fwd, struct gpio_desc *desc,
}
EXPORT_SYMBOL_NS_GPL(gpio_fwd_add_gpio_desc, "GPIO_FORWARDER");
-int gpio_fwd_register(struct gpiochip_fwd *fwd)
+int gpio_fwd_register(struct gpiochip_fwd *fwd, void *data)
{
struct gpio_chip *chip = &fwd->chip;
unsigned int ndescs = 0, i;
@@ -586,6 +586,8 @@ int gpio_fwd_register(struct gpiochip_fwd *fwd)
else
spin_lock_init(&fwd->slock);
+ fwd->data = data;
+
error = devm_gpiochip_add_data(chip->parent, chip, fwd);
return error;
@@ -632,7 +634,7 @@ static struct gpiochip_fwd *gpio_fwd_create(struct device *dev,
return ERR_PTR(error);
}
- error = gpio_fwd_register(fwd);
+ error = gpio_fwd_register(fwd, NULL);
if (error)
return ERR_PTR(error);
diff --git a/include/linux/gpio/forwarder.h b/include/linux/gpio/forwarder.h
index f3fba3c39bda..304c793313db 100644
--- a/include/linux/gpio/forwarder.h
+++ b/include/linux/gpio/forwarder.h
@@ -18,6 +18,7 @@ struct gpiochip_fwd_timing {
struct gpiochip_fwd {
struct gpio_chip chip;
+ void *data;
struct gpio_desc **descs;
union {
struct mutex mlock; /* protects tmp[] if can_sleep */
@@ -57,6 +58,6 @@ struct gpiochip_fwd *devm_gpio_fwd_alloc(struct device *dev,
int gpio_fwd_add_gpio_desc(struct gpiochip_fwd *fwd,
struct gpio_desc *desc, unsigned int offset);
-int gpio_fwd_register(struct gpiochip_fwd *fwd);
+int gpio_fwd_register(struct gpiochip_fwd *fwd, void *data);
#endif
--
2.39.5
Powered by blists - more mailing lists