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

Input: gpio_keys_polled - 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-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

authored by

Andy Shevchenko and committed by
Bartosz Golaszewski
081aaf2d a04abf25

+5 -7
+5 -7
drivers/input/keyboard/gpio_keys_polled.c
··· 306 306 * Legacy GPIO number so request the GPIO here and 307 307 * convert it to descriptor. 308 308 */ 309 - unsigned flags = GPIOF_IN; 310 - 311 - if (button->active_low) 312 - flags |= GPIOF_ACTIVE_LOW; 313 - 314 - error = devm_gpio_request_one(dev, button->gpio, 315 - flags, button->desc ? : DRV_NAME); 309 + error = devm_gpio_request_one(dev, button->gpio, GPIOF_IN, 310 + button->desc ? : DRV_NAME); 316 311 if (error) 317 312 return dev_err_probe(dev, error, 318 313 "unable to claim gpio %u\n", ··· 320 325 button->gpio); 321 326 return -EINVAL; 322 327 } 328 + 329 + if (button->active_low ^ gpiod_is_active_low(bdata->gpiod)) 330 + gpiod_toggle_active_low(bdata->gpiod); 323 331 } 324 332 325 333 bdata->last_state = -1;