[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAOiHx=kawxL8ABs9D3t8OCXDX+YynpzkipqhTP1ZgpViONi+qw@mail.gmail.com>
Date: Tue, 7 Jan 2025 11:43:14 +0100
From: Jonas Gorski <jonas.gorski@...il.com>
To: Álvaro Fernández Rojas <noltari@...il.com>
Cc: 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
Subject: Re: [PATCH 1/2] gpio: regmap: add request/free gpio_chip functions
Hi,
On Tue, Jan 7, 2025 at 11:27 AM Álvaro Fernández Rojas
<noltari@...il.com> wrote:
>
> 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;
I wonder if you couldn't just use gpiochip_generic_request() /
gpiochip_generic_free() unconditionally here. AFAIU, these don't do
anything when there are no GPIO ranges defined (so should not
interfere with non-pinctrl linked devices), as well as nothing when
CONFIG_PINCTRL isn't enabled, so they should be NOPs if there is no
pinctrl link, and do the right thing if there is one.
Best Regards,
Jonas
Powered by blists - more mailing lists