aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86/intel-hid.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-08-29 00:15:47 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-08-29 00:15:47 +0200
commitcba630b6f5cf6bb468f5c2da77f3dee2125bd0c1 (patch)
treefa2197409bddcf6faaf084cb64895f4c531bfa73 /drivers/platform/x86/intel-hid.c
parentPM: docs: Describe high-level PM strategies and sleep states (diff)
parentACPI / PM: Check low power idle constraints for debug only (diff)
downloadlinux-dev-cba630b6f5cf6bb468f5c2da77f3dee2125bd0c1.tar.xz
linux-dev-cba630b6f5cf6bb468f5c2da77f3dee2125bd0c1.zip
Merge branch 'pm-sleep' into pm-docs
Diffstat (limited to 'drivers/platform/x86/intel-hid.c')
-rw-r--r--drivers/platform/x86/intel-hid.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/platform/x86/intel-hid.c b/drivers/platform/x86/intel-hid.c
index 8519e0f97bdd..a782c78e7c63 100644
--- a/drivers/platform/x86/intel-hid.c
+++ b/drivers/platform/x86/intel-hid.c
@@ -203,15 +203,26 @@ static void notify_handler(acpi_handle handle, u32 event, void *context)
acpi_status status;
if (priv->wakeup_mode) {
+ /*
+ * Needed for wakeup from suspend-to-idle to work on some
+ * platforms that don't expose the 5-button array, but still
+ * send notifies with the power button event code to this
+ * device object on power button actions while suspended.
+ */
+ if (event == 0xce)
+ goto wakeup;
+
/* Wake up on 5-button array events only. */
if (event == 0xc0 || !priv->array)
return;
- if (sparse_keymap_entry_from_scancode(priv->array, event))
- pm_wakeup_hard_event(&device->dev);
- else
+ if (!sparse_keymap_entry_from_scancode(priv->array, event)) {
dev_info(&device->dev, "unknown event 0x%x\n", event);
+ return;
+ }
+wakeup:
+ pm_wakeup_hard_event(&device->dev);
return;
}