aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-07-27 20:06:36 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-08-01 17:11:17 -0400
commit635173a17b0323c28a39fb06fa36d876035cd2b9 (patch)
treeb7a4bd604eee3135e7a011d4610b92b63f0e4fa5
parent142bce74fd141913b2127970a9bd90f33c5b7653 (diff)
platform/x86: intel-hid: Wake up Dell Latitude 7275 from suspend-to-idle
On Dell Latitude 7275 the 5-button array is not exposed in the ACPI tables, but still notifies are sent to the Intel HID device object (device ID INT33D5) in response to power button actions while suspended to idle. However, they are currently ignored as the intel-hid driver is not prepared to take care of them. As a result, power button wakeup from suspend-to-idle doesn't work on this platform, but suspend-to-idle is the only reliable suspend variant on it (the S3 implementation in the platform firmware turns out to be broken), so it would be good to handle it properly. For this reason, add an upfront check against the power button press event (0xCE) to notify_handler() in the wakeup mode which allows it to catch the power button wakeup notification on the affected platform (even though priv->array is NULL on it) and should not change the behavior on platforms with priv->array present (because priv->array contains the event in question in those cases). Link: https://bugzilla.kernel.org/show_bug.cgi?id=196115 Tested-by: Jérôme de Bretagne <jerome.debretagne@gmail.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Andy Shevchenko <andy.shevchenko@gmail.com> Acked-By: Mario Limonciello <mario.limonciello@dell.com>
-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)
203 acpi_status status; 203 acpi_status status;
204 204
205 if (priv->wakeup_mode) { 205 if (priv->wakeup_mode) {
206 /*
207 * Needed for wakeup from suspend-to-idle to work on some
208 * platforms that don't expose the 5-button array, but still
209 * send notifies with the power button event code to this
210 * device object on power button actions while suspended.
211 */
212 if (event == 0xce)
213 goto wakeup;
214
206 /* Wake up on 5-button array events only. */ 215 /* Wake up on 5-button array events only. */
207 if (event == 0xc0 || !priv->array) 216 if (event == 0xc0 || !priv->array)
208 return; 217 return;
209 218
210 if (sparse_keymap_entry_from_scancode(priv->array, event)) 219 if (!sparse_keymap_entry_from_scancode(priv->array, event)) {
211 pm_wakeup_hard_event(&device->dev);
212 else
213 dev_info(&device->dev, "unknown event 0x%x\n", event); 220 dev_info(&device->dev, "unknown event 0x%x\n", event);
221 return;
222 }
214 223
224wakeup:
225 pm_wakeup_hard_event(&device->dev);
215 return; 226 return;
216 } 227 }
217 228