aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86/intel-hid.c
diff options
context:
space:
mode:
authorJérôme de Bretagne <jerome.debretagne@gmail.com>2017-09-18 00:57:12 +0200
committerDarren Hart (VMware) <dvhart@infradead.org>2017-09-22 16:49:47 -0700
commit821b85366284542e00dd834062144c637e818ee0 (patch)
tree71cb03a21f3bbc000a126d7cb4132d71b6df87cd /drivers/platform/x86/intel-hid.c
parentplatform/x86: intel-wmi-thunderbolt: Silence error cases (diff)
downloadlinux-dev-821b85366284542e00dd834062144c637e818ee0.tar.xz
linux-dev-821b85366284542e00dd834062144c637e818ee0.zip
platform/x86: intel-hid: Power button suspend on Dell Latitude 7275
On Dell Latitude 7275 the 5-button array is not exposed in the ACPI tables, but notififies are still sent to the Intel HID device object (device ID INT33D5) in response to power button actions. They were ignored as the intel-hid driver was not prepared to take care of them until recently. Power button wakeup from suspend-to-idle was added in: commit 635173a17b03 ("intel-hid: Wake up Dell Latitude 7275 from suspend-to-idle") However power button suspend doesn't work yet on this platform so it would be good to add it also. On the affected platform (for which priv->array is NULL), add a new upfront check against the power button press notification (0xCE) to notify_handler(), outside the wakeup mode this time, which allows reporting the power button press event and triggers the suspend. Also catch and ignore the corresponding power button release notification (0xCF) to stop it from being reported as an "unknown event" in the logs. Link: https://bugzilla.kernel.org/show_bug.cgi?id=196115 Tested-by: Jérôme de Bretagne <jerome.debretagne@gmail.com> Signed-off-by: Jérôme de Bretagne <jerome.debretagne@gmail.com> Acked-By: Mario Limonciello <mario.limonciello@dell.com> [dvhart: minor coding style and commit message format fix] Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
Diffstat (limited to 'drivers/platform/x86/intel-hid.c')
-rw-r--r--drivers/platform/x86/intel-hid.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/platform/x86/intel-hid.c b/drivers/platform/x86/intel-hid.c
index e34fd70b67af..f470279c4c10 100644
--- a/drivers/platform/x86/intel-hid.c
+++ b/drivers/platform/x86/intel-hid.c
@@ -226,6 +226,24 @@ wakeup:
return;
}
+ /*
+ * Needed for suspend to work on some platforms that don't expose
+ * the 5-button array, but still send notifies with power button
+ * event code to this device object on power button actions.
+ *
+ * Report the power button press; catch and ignore the button release.
+ */
+ if (!priv->array) {
+ if (event == 0xce) {
+ input_report_key(priv->input_dev, KEY_POWER, 1);
+ input_sync(priv->input_dev);
+ return;
+ }
+
+ if (event == 0xcf)
+ return;
+ }
+
/* 0xC0 is for HID events, other values are for 5 button array */
if (event != 0xc0) {
if (!priv->array ||