aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2018-01-10 07:26:35 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2018-01-11 12:54:50 -0500
commit19351f340765ebef48d07eade8ffb5f6f1118244 (patch)
tree99294de970cc104c6435e6f8065bbc239f123f40
parent29a5a6d7082427371519ae1e186d9e35612801fb (diff)
platform/x86: surfacepro3: Support for wakeup from suspend-to-idle
Modify surface_button_notify() to make it wake up the system from suspend-to-idle (by reporting "hard" wakeup events while suspended) and add wakeup initialization to surface_button_add() for wakeup events reported by this driver to work at all. Link: https://bugzilla.kernel.org/show_bug.cgi?id=198389 Reported-by: Valentin Manea <valy@mrs.ro> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: Valentin Manea <valy@mrs.ro>
-rw-r--r--drivers/platform/x86/surfacepro3_button.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/platform/x86/surfacepro3_button.c b/drivers/platform/x86/surfacepro3_button.c
index 6505c97705e1..1b491690ce07 100644
--- a/drivers/platform/x86/surfacepro3_button.c
+++ b/drivers/platform/x86/surfacepro3_button.c
@@ -119,7 +119,7 @@ static void surface_button_notify(struct acpi_device *device, u32 event)
119 if (key_code == KEY_RESERVED) 119 if (key_code == KEY_RESERVED)
120 return; 120 return;
121 if (pressed) 121 if (pressed)
122 pm_wakeup_event(&device->dev, 0); 122 pm_wakeup_dev_event(&device->dev, 0, button->suspended);
123 if (button->suspended) 123 if (button->suspended)
124 return; 124 return;
125 input_report_key(input, key_code, pressed?1:0); 125 input_report_key(input, key_code, pressed?1:0);
@@ -185,6 +185,8 @@ static int surface_button_add(struct acpi_device *device)
185 error = input_register_device(input); 185 error = input_register_device(input);
186 if (error) 186 if (error)
187 goto err_free_input; 187 goto err_free_input;
188
189 device_init_wakeup(&device->dev, true);
188 dev_info(&device->dev, 190 dev_info(&device->dev,
189 "%s [%s]\n", name, acpi_device_bid(device)); 191 "%s [%s]\n", name, acpi_device_bid(device));
190 return 0; 192 return 0;