From: Vincent Pelletier Date: Thu, 20 Aug 2015 19:00:19 +0000 (-0700) Subject: Input: gpio_keys_polled - request GPIO pin as input. X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=1ae5ddb6f8837558928a1a694c7b8af7f09fdd21;p=sagit-ice-cold%2Fkernel_xiaomi_msm8998.git Input: gpio_keys_polled - request GPIO pin as input. GPIOF_IN flag was lost in: Commit 633a21d80b4a("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). Cc: stable@vger.kernel.org Signed-off-by: Vincent Pelletier Reviewed-by: Mika Westerberg Signed-off-by: Dmitry Torokhov --- diff --git a/drivers/input/keyboard/gpio_keys_polled.c b/drivers/input/keyboard/gpio_keys_polled.c index 90df4df58b07..959b826d25c8 100644 --- a/drivers/input/keyboard/gpio_keys_polled.c +++ b/drivers/input/keyboard/gpio_keys_polled.c @@ -246,7 +246,7 @@ static int gpio_keys_polled_probe(struct platform_device *pdev) * convert it to descriptor. */ if (!button->gpiod && gpio_is_valid(button->gpio)) { - unsigned flags = 0; + unsigned flags = GPIOF_IN; if (button->active_low) flags |= GPIOF_ACTIVE_LOW;