Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Input: gpio_keys - avoid using GPIOF_ACTIVE_LOW

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

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20241104093609.156059-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

authored by

Andy Shevchenko and committed by
Bartosz Golaszewski
a04abf25 aca4d221

+4 -6
+4 -6
drivers/input/keyboard/gpio_keys.c
··· 531 531 * Legacy GPIO number, so request the GPIO here and 532 532 * convert it to descriptor. 533 533 */ 534 - unsigned flags = GPIOF_IN; 535 - 536 - if (button->active_low) 537 - flags |= GPIOF_ACTIVE_LOW; 538 - 539 - error = devm_gpio_request_one(dev, button->gpio, flags, desc); 534 + error = devm_gpio_request_one(dev, button->gpio, GPIOF_IN, desc); 540 535 if (error < 0) { 541 536 dev_err(dev, "Failed to request GPIO %d, error %d\n", 542 537 button->gpio, error); ··· 541 546 bdata->gpiod = gpio_to_desc(button->gpio); 542 547 if (!bdata->gpiod) 543 548 return -EINVAL; 549 + 550 + if (button->active_low ^ gpiod_is_active_low(bdata->gpiod)) 551 + gpiod_toggle_active_low(bdata->gpiod); 544 552 } 545 553 546 554 if (bdata->gpiod) {