]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.1.7/input-gpio_keys_polled-request-gpio-pin-as-input.patch
4.14-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.1.7 / input-gpio_keys_polled-request-gpio-pin-as-input.patch
1 From 1ae5ddb6f8837558928a1a694c7b8af7f09fdd21 Mon Sep 17 00:00:00 2001
2 From: Vincent Pelletier <plr.vincent@gmail.com>
3 Date: Thu, 20 Aug 2015 12:00:19 -0700
4 Subject: Input: gpio_keys_polled - request GPIO pin as input.
5
6 From: Vincent Pelletier <plr.vincent@gmail.com>
7
8 commit 1ae5ddb6f8837558928a1a694c7b8af7f09fdd21 upstream.
9
10 GPIOF_IN flag was lost in:
11 Commit 633a21d80b4a("input: gpio_keys_polled: Add support for GPIO
12 descriptors").
13
14 Without this flag, legacy code path (for non-descriptor GPIO declarations)
15 would configure GPIO as output (0 meaning GPIOF_DIR_OUT | GPIOF_INIT_LOW).
16
17 Signed-off-by: Vincent Pelletier <plr.vincent@gmail.com>
18 Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
19 Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
20 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
21
22 ---
23 drivers/input/keyboard/gpio_keys_polled.c | 2 +-
24 1 file changed, 1 insertion(+), 1 deletion(-)
25
26 --- a/drivers/input/keyboard/gpio_keys_polled.c
27 +++ b/drivers/input/keyboard/gpio_keys_polled.c
28 @@ -246,7 +246,7 @@ static int gpio_keys_polled_probe(struct
29 * convert it to descriptor.
30 */
31 if (!button->gpiod && gpio_is_valid(button->gpio)) {
32 - unsigned flags = 0;
33 + unsigned flags = GPIOF_IN;
34
35 if (button->active_low)
36 flags |= GPIOF_ACTIVE_LOW;