]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.19/platform-x86-intel-hid-missing-power-button-release-.patch
Linux 4.14.111
[thirdparty/kernel/stable-queue.git] / queue-4.19 / platform-x86-intel-hid-missing-power-button-release-.patch
1 From 8e7838171fbd413bd7c7a05b86a74da3d2e39a22 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20de=20Bretagne?=
3 <jerome.debretagne@gmail.com>
4 Date: Sun, 6 Jan 2019 18:56:44 +0100
5 Subject: platform/x86: intel-hid: Missing power button release on some Dell
6 models
7 MIME-Version: 1.0
8 Content-Type: text/plain; charset=UTF-8
9 Content-Transfer-Encoding: 8bit
10
11 [ Upstream commit e97a34563d18606ee5db93e495382a967f999cd4 ]
12
13 Power button suspend for some Dell models was added in:
14
15 commit 821b85366284 ("platform/x86: intel-hid: Power button suspend on Dell Latitude 7275")
16
17 by checking against the power button press notification (0xCE) to report
18 the power button press event. The corresponding power button release
19 notification (0xCF) was caught and ignored to stop it from being reported
20 as an "unknown event" in the logs.
21
22 The missing button release event is creating issues on Android-x86, as
23 reported on the project mailing list for a Dell Latitude 5175 model, since
24 the events are expected in down/up pairs.
25
26 Report the power button release event to fix this issue.
27
28 Link: https://groups.google.com/forum/#!topic/android-x86/aSwZK9Nf9Ro
29 Tested-by: Tristian Celestin <tristian.celestin@outlook.com>
30 Tested-by: Jérôme de Bretagne <jerome.debretagne@gmail.com>
31 Signed-off-by: Jérôme de Bretagne <jerome.debretagne@gmail.com>
32 Reviewed-by: Mario Limonciello <mario.limonciello@dell.com>
33 [dvhart: corrected commit reference format per checkpatch]
34 Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
35 Signed-off-by: Sasha Levin <sashal@kernel.org>
36 ---
37 drivers/platform/x86/intel-hid.c | 7 +++++--
38 1 file changed, 5 insertions(+), 2 deletions(-)
39
40 diff --git a/drivers/platform/x86/intel-hid.c b/drivers/platform/x86/intel-hid.c
41 index 6cf9b7fa5bf0..3201a83073b5 100644
42 --- a/drivers/platform/x86/intel-hid.c
43 +++ b/drivers/platform/x86/intel-hid.c
44 @@ -373,7 +373,7 @@ wakeup:
45 * the 5-button array, but still send notifies with power button
46 * event code to this device object on power button actions.
47 *
48 - * Report the power button press; catch and ignore the button release.
49 + * Report the power button press and release.
50 */
51 if (!priv->array) {
52 if (event == 0xce) {
53 @@ -382,8 +382,11 @@ wakeup:
54 return;
55 }
56
57 - if (event == 0xcf)
58 + if (event == 0xcf) {
59 + input_report_key(priv->input_dev, KEY_POWER, 0);
60 + input_sync(priv->input_dev);
61 return;
62 + }
63 }
64
65 /* 0xC0 is for HID events, other values are for 5 button array */
66 --
67 2.19.1
68