Commit ca1868ab authored by Vincent Pelletier's avatar Vincent Pelletier Committed by Greg Kroah-Hartman

Input: gpio_keys_polled - request GPIO pin as input.

commit 1ae5ddb6 upstream.

GPIOF_IN flag was lost in:
Commit 633a21d8("input: gpio_keys_polled: Add support for GPIO
descriptors").

Without this flag, legacy code path (for non-descriptor GPIO declarations)
would configure GPIO as output (0 meaning GPIOF_DIR_OUT | GPIOF_INIT_LOW).
Signed-off-by: default avatarVincent Pelletier <plr.vincent@gmail.com>
Reviewed-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7aadce45
...@@ -246,7 +246,7 @@ static int gpio_keys_polled_probe(struct platform_device *pdev) ...@@ -246,7 +246,7 @@ static int gpio_keys_polled_probe(struct platform_device *pdev)
* convert it to descriptor. * convert it to descriptor.
*/ */
if (!button->gpiod && gpio_is_valid(button->gpio)) { if (!button->gpiod && gpio_is_valid(button->gpio)) {
unsigned flags = 0; unsigned flags = GPIOF_IN;
if (button->active_low) if (button->active_low)
flags |= GPIOF_ACTIVE_LOW; flags |= GPIOF_ACTIVE_LOW;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment