Commit 1f83511b authored by Rafael J. Wysocki's avatar Rafael J. Wysocki Committed by Len Brown

ACPI / PM: Report wakeup events from buttons

Since ACPI buttons and lids can be configured to wake up the system
from sleep states, report wakeup events from these devices.
Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 7fa69baf
...@@ -279,6 +279,9 @@ static int acpi_lid_send_state(struct acpi_device *device) ...@@ -279,6 +279,9 @@ static int acpi_lid_send_state(struct acpi_device *device)
input_report_switch(button->input, SW_LID, !state); input_report_switch(button->input, SW_LID, !state);
input_sync(button->input); input_sync(button->input);
if (state)
pm_wakeup_event(&device->dev, 0);
ret = blocking_notifier_call_chain(&acpi_lid_notifier, state, device); ret = blocking_notifier_call_chain(&acpi_lid_notifier, state, device);
if (ret == NOTIFY_DONE) if (ret == NOTIFY_DONE)
ret = blocking_notifier_call_chain(&acpi_lid_notifier, state, ret = blocking_notifier_call_chain(&acpi_lid_notifier, state,
...@@ -314,6 +317,8 @@ static void acpi_button_notify(struct acpi_device *device, u32 event) ...@@ -314,6 +317,8 @@ static void acpi_button_notify(struct acpi_device *device, u32 event)
input_sync(input); input_sync(input);
input_report_key(input, keycode, 0); input_report_key(input, keycode, 0);
input_sync(input); input_sync(input);
pm_wakeup_event(&device->dev, 0);
} }
acpi_bus_generate_proc_event(device, event, ++button->pushed); acpi_bus_generate_proc_event(device, event, ++button->pushed);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment