[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zymw17NOSw2zciO9@google.com>
Date: Mon, 4 Nov 2024 21:44:55 -0800
From: Dmitry Torokhov <dmitry.torokhov@...il.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: Bartosz Golaszewski <bartosz.golaszewski@...aro.org>,
Tony Lindgren <tony@...mide.com>, Lee Jones <lee@...nel.org>,
linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-input@...r.kernel.org, linux-leds@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-usb@...r.kernel.org,
Linus Walleij <linus.walleij@...aro.org>,
Bartosz Golaszewski <brgl@...ev.pl>, Pavel Machek <pavel@....cz>,
Dominik Brodowski <linux@...inikbrodowski.net>,
Daniel Mack <daniel@...que.org>,
Haojian Zhuang <haojian.zhuang@...il.com>,
Robert Jarzmik <robert.jarzmik@...e.fr>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [PATCH v1 1/6] Input: gpio_keys - avoid using GPIOF_ACTIVE_LOW
On Mon, Nov 04, 2024 at 11:34:19AM +0200, Andy Shevchenko wrote:
> Avoid using GPIOF_ACTIVE_LOW as it's deprecated and subject to remove.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@...il.com>
> ---
> drivers/input/keyboard/gpio_keys.c | 10 ++++------
> 1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
> index 380fe8dab3b0..5eef66516e37 100644
> --- a/drivers/input/keyboard/gpio_keys.c
> +++ b/drivers/input/keyboard/gpio_keys.c
> @@ -531,12 +531,7 @@ static int gpio_keys_setup_key(struct platform_device *pdev,
> * Legacy GPIO number, so request the GPIO here and
> * convert it to descriptor.
> */
> - unsigned flags = GPIOF_IN;
> -
> - if (button->active_low)
> - flags |= GPIOF_ACTIVE_LOW;
> -
> - error = devm_gpio_request_one(dev, button->gpio, flags, desc);
> + error = devm_gpio_request_one(dev, button->gpio, GPIOF_IN, desc);
> if (error < 0) {
> dev_err(dev, "Failed to request GPIO %d, error %d\n",
> button->gpio, error);
> @@ -546,6 +541,9 @@ static int gpio_keys_setup_key(struct platform_device *pdev,
> bdata->gpiod = gpio_to_desc(button->gpio);
> if (!bdata->gpiod)
> return -EINVAL;
> +
> + if (button->active_low ^ gpiod_is_active_low(bdata->gpiod))
> + gpiod_toggle_active_low(bdata->gpiod);
> }
>
> if (bdata->gpiod) {
> --
> 2.43.0.rc1.1336.g36b5255a03ac
>
--
Dmitry
Powered by blists - more mailing lists