[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <D6WJSWR2776G.31DIV7I8QR42J@kernel.org>
Date: Wed, 08 Jan 2025 09:28:05 +0100
From: "Michael Walle" <mwalle@...nel.org>
To: "Sander Vanheule" <sander@...nheule.net>, "Linus Walleij"
<linus.walleij@...aro.org>, "Bartosz Golaszewski" <brgl@...ev.pl>,
<linux-gpio@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Cc: Álvaro Fernández Rojas <noltari@...il.com>,
<jonas.gorski@...il.com>, <kylehendrydev@...il.com>,
<florian.fainelli@...adcom.com>
Subject: Re: [PATCH] gpio: regmap: Use generic request/free ops
Hi,
On Tue Jan 7, 2025 at 9:16 PM CET, Sander Vanheule wrote:
> Set the gpiochip request and free ops to the generic implementations.
> This way a user can provide a gpio-ranges property defined for a pinmux,
> easing muxing of gpio functions. Provided that the pin controller
> implementents the pinmux op .gpio_request_enable(), pins will
> automatically be muxed to their GPIO function when requested.
>
> Signed-off-by: Sander Vanheule <sander@...nheule.net>
Sounds fine, although I don't have time to test it right now. I'd
appreciate if Linus could give a short comment, too.
Acked-by: Michael Walle <mwalle@...nel.org>
-michael
> ---
> Álvaro has submitted a similar patch today. My implementation's impact
> is more limited, but I hadn't gotten around to submitting it yet.
>
> For the original (short) discussion, see:
> https://lore.kernel.org/linux-gpio/20250107102735.317446-1-noltari@gmail.com/T/#t
>
> drivers/gpio/gpio-regmap.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpio/gpio-regmap.c b/drivers/gpio/gpio-regmap.c
> index f716eb069b25..82da0f1d78c3 100644
> --- a/drivers/gpio/gpio-regmap.c
> +++ b/drivers/gpio/gpio-regmap.c
> @@ -270,6 +270,8 @@ struct gpio_regmap *gpio_regmap_register(const struct gpio_regmap_config *config
> chip->label = config->label ?: dev_name(config->parent);
> chip->can_sleep = regmap_might_sleep(config->regmap);
>
> + chip->request = gpiochip_generic_request;
> + chip->free = gpiochip_generic_free;
> chip->get = gpio_regmap_get;
> if (gpio->reg_set_base && gpio->reg_clr_base)
> chip->set = gpio_regmap_set_with_clear;
Download attachment "signature.asc" of type "application/pgp-signature" (298 bytes)
Powered by blists - more mailing lists