[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250216125816.14430-7-koichiro.den@canonical.com>
Date: Sun, 16 Feb 2025 21:58:09 +0900
From: Koichiro Den <koichiro.den@...onical.com>
To: linux-gpio@...r.kernel.org
Cc: brgl@...ev.pl,
geert+renesas@...der.be,
linus.walleij@...aro.org,
maciej.borzecki@...onical.com,
linux-kernel@...r.kernel.org
Subject: [PATCH v3 06/13] gpio: aggregator: convert to use gpio-pseudo utilities
Update gpio-aggregator to use the new gpio-pseudo helper functions.
Note that the current sysfs interface for gpio-aggregator does not wait
for probe completion when creating a platform device. This change brings
no immediate benefit but prepares for a later commit introducing
configfs that shares this mechanism.
No functional change.
Signed-off-by: Koichiro Den <koichiro.den@...onical.com>
---
drivers/gpio/Kconfig | 1 +
drivers/gpio/gpio-aggregator.c | 8 +++++---
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
index d8fede07149f..8b9ffe17426e 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -1871,6 +1871,7 @@ menu "Virtual GPIO drivers"
config GPIO_AGGREGATOR
tristate "GPIO Aggregator"
+ select GPIO_PSEUDO
help
Say yes here to enable the GPIO Aggregator, which provides a way to
aggregate existing GPIO lines into a new virtual GPIO chip.
diff --git a/drivers/gpio/gpio-aggregator.c b/drivers/gpio/gpio-aggregator.c
index 893cd56de867..b24ed963cd9a 100644
--- a/drivers/gpio/gpio-aggregator.c
+++ b/drivers/gpio/gpio-aggregator.c
@@ -27,6 +27,8 @@
#include <linux/gpio/driver.h>
#include <linux/gpio/machine.h>
+#include "gpio-pseudo.h"
+
#define AGGREGATOR_MAX_GPIOS 512
/*
@@ -34,8 +36,8 @@
*/
struct gpio_aggregator {
+ struct pseudo_gpio_common common;
struct gpiod_lookup_table *lookups;
- struct platform_device *pdev;
char args[];
};
@@ -492,7 +494,7 @@ static ssize_t new_device_store(struct device_driver *driver, const char *buf,
goto remove_table;
}
- aggr->pdev = pdev;
+ aggr->common.pdev = pdev;
module_put(THIS_MODULE);
return count;
@@ -517,7 +519,7 @@ static DRIVER_ATTR_WO(new_device);
static void gpio_aggregator_free(struct gpio_aggregator *aggr)
{
- platform_device_unregister(aggr->pdev);
+ platform_device_unregister(aggr->common.pdev);
gpiod_remove_lookup_table(aggr->lookups);
kfree(aggr->lookups->dev_id);
kfree(aggr->lookups);
--
2.45.2
Powered by blists - more mailing lists