]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.19/input-soc_button_array-fix-mapping-of-the-5th-gpio-i.patch
Linux 4.14.111
[thirdparty/kernel/stable-queue.git] / queue-4.19 / input-soc_button_array-fix-mapping-of-the-5th-gpio-i.patch
1 From 6359592e7dd8f4abfdb34051e190af0a1e6183d8 Mon Sep 17 00:00:00 2001
2 From: Hans de Goede <hdegoede@redhat.com>
3 Date: Thu, 3 Jan 2019 18:10:45 -0800
4 Subject: Input: soc_button_array - fix mapping of the 5th GPIO in a PNP0C40
5 device
6
7 [ Upstream commit e9eb788f9442d1b5d93efdb30c3be071ce8a22b1 ]
8
9 The Microsoft documenation for the PNP0C40 device aka the
10 "Windows-compatible button array" describes the 5th GpioInt listed in
11 the resources as: '5. Interrupt corresponding to the "Rotation Lock"
12 button, if supported'.
13
14 Notice this describes the 5th entry as a button while we sofar have been
15 mapping it to EV_SW, SW_ROTATE_LOCK. On my Point of View TAB P1006W-232
16 which actually comes with a rotation-lock button, the button indeed is a
17 button and not a slider/switch. An image search for other Windows tablets
18 has found 2 more models with a rotation-lock button and on both of those
19 it too is a push-button and not a slider/switch.
20
21 Further evidence can be found in the HUT extension HUTRR52 from Microsoft
22 which adds rotation lock support to the HUT, which describes 2 different
23 usages: "0xC9 System Display Rotation Lock Button" and
24 "0xCA System Display Rotation Lock Slider Switch" note that switch is seen
25 as a separate thing here and the non switch wording is an exact match for
26 the "Windows-compatible button array" spec wording.
27
28 TL;DR: our current mapping of the 5th GPIO to SW_ROTATE_LOCK is wrong
29 because the 5th GPIO is for a push-button not a switch.
30
31 This commit fixes this by maping the 5th GPIO to KEY_ROTATE_LOCK_TOGGLE.
32
33 Signed-off-by: Hans de Goede <hdegoede@redhat.com>
34 Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
35 Signed-off-by: Sasha Levin <sashal@kernel.org>
36 ---
37 drivers/input/misc/soc_button_array.c | 2 +-
38 1 file changed, 1 insertion(+), 1 deletion(-)
39
40 diff --git a/drivers/input/misc/soc_button_array.c b/drivers/input/misc/soc_button_array.c
41 index 23520df7650f..55cd6e0b409c 100644
42 --- a/drivers/input/misc/soc_button_array.c
43 +++ b/drivers/input/misc/soc_button_array.c
44 @@ -373,7 +373,7 @@ static struct soc_button_info soc_button_PNP0C40[] = {
45 { "home", 1, EV_KEY, KEY_LEFTMETA, false, true },
46 { "volume_up", 2, EV_KEY, KEY_VOLUMEUP, true, false },
47 { "volume_down", 3, EV_KEY, KEY_VOLUMEDOWN, true, false },
48 - { "rotation_lock", 4, EV_SW, SW_ROTATE_LOCK, false, false },
49 + { "rotation_lock", 4, EV_KEY, KEY_ROTATE_LOCK_TOGGLE, false, false },
50 { }
51 };
52
53 --
54 2.19.1
55