linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Bartosz Golaszewski <bartosz.golaszewski@linaro.org>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Tony Lindgren <tony@atomide.com>, Lee Jones <lee@kernel.org>,
	linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-input@vger.kernel.org, linux-leds@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org
Cc: Linus Walleij <linus.walleij@linaro.org>,
	Bartosz Golaszewski <brgl@bgdev.pl>, Pavel Machek <pavel@ucw.cz>,
	Dominik Brodowski <linux@dominikbrodowski.net>,
	Daniel Mack <daniel@zonque.org>,
	Haojian Zhuang <haojian.zhuang@gmail.com>,
	Robert Jarzmik <robert.jarzmik@free.fr>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: [PATCH v1 1/6] Input: gpio_keys - avoid using GPIOF_ACTIVE_LOW
Date: Mon,  4 Nov 2024 11:34:19 +0200	[thread overview]
Message-ID: <20241104093609.156059-2-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20241104093609.156059-1-andriy.shevchenko@linux.intel.com>

Avoid using GPIOF_ACTIVE_LOW as it's deprecated and subject to remove.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.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


  reply	other threads:[~2024-11-04  9:36 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-04  9:34 [PATCH v1 0/6] gpio: Get rid of deprecated GPIOF_ACTIVE_LOW Andy Shevchenko
2024-11-04  9:34 ` Andy Shevchenko [this message]
2024-11-05  5:44   ` [PATCH v1 1/6] Input: gpio_keys - avoid using GPIOF_ACTIVE_LOW Dmitry Torokhov
2024-11-08  8:33   ` Linus Walleij
2024-11-04  9:34 ` [PATCH v1 2/6] Input: gpio_keys_polled " Andy Shevchenko
2024-11-05  5:45   ` Dmitry Torokhov
2024-11-08  8:33   ` Linus Walleij
2024-11-04  9:34 ` [PATCH v1 3/6] leds: gpio: Avoid " Andy Shevchenko
2024-11-06  9:55   ` Lee Jones
2024-11-08  8:37   ` Linus Walleij
2024-11-11  9:45   ` Geert Uytterhoeven
2024-11-11  9:56     ` Andy Shevchenko
2024-11-11 10:21       ` Geert Uytterhoeven
2024-11-04  9:34 ` [PATCH v1 4/6] pcmcia: soc_common: " Andy Shevchenko
2024-11-08  8:28   ` Linus Walleij
2024-11-08  8:35     ` Andy Shevchenko
2024-11-09  6:40       ` Dominik Brodowski
2024-11-11  7:31         ` Andy Shevchenko
2024-11-04  9:34 ` [PATCH v1 5/6] USB: gadget: pxa27x_udc: " Andy Shevchenko
2024-11-05 12:26   ` Greg Kroah-Hartman
2024-11-08  8:34   ` Linus Walleij
2024-11-04  9:34 ` [PATCH v1 6/6] gpio: Get rid of GPIOF_ACTIVE_LOW Andy Shevchenko
2024-11-08  8:29   ` Linus Walleij
2024-11-06 11:15 ` [PATCH v1 0/6] gpio: Get rid of deprecated GPIOF_ACTIVE_LOW Andy Shevchenko
2024-11-06 13:43   ` Bartosz Golaszewski
2024-11-09 13:56 ` Bartosz Golaszewski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241104093609.156059-2-andriy.shevchenko@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=bartosz.golaszewski@linaro.org \
    --cc=brgl@bgdev.pl \
    --cc=daniel@zonque.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=haojian.zhuang@gmail.com \
    --cc=lee@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux@dominikbrodowski.net \
    --cc=pavel@ucw.cz \
    --cc=robert.jarzmik@free.fr \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).