From: Rafael J. Wysocki Date: Thu, 6 Jan 2011 22:36:01 +0000 (+0100) Subject: ACPI / PM: Report wakeup events from buttons X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1f83511bd8f44b8a9e2d82263b2c95f26a625fcc;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git 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: Rafael J. Wysocki Signed-off-by: Len Brown --- diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c index 234c104fcdd..76bbb78a5ad 100644 --- a/drivers/acpi/button.c +++ b/drivers/acpi/button.c @@ -279,6 +279,9 @@ static int acpi_lid_send_state(struct acpi_device *device) input_report_switch(button->input, SW_LID, !state); input_sync(button->input); + if (state) + pm_wakeup_event(&device->dev, 0); + ret = blocking_notifier_call_chain(&acpi_lid_notifier, state, device); if (ret == NOTIFY_DONE) ret = blocking_notifier_call_chain(&acpi_lid_notifier, state, @@ -314,6 +317,8 @@ static void acpi_button_notify(struct acpi_device *device, u32 event) input_sync(input); input_report_key(input, keycode, 0); input_sync(input); + + pm_wakeup_event(&device->dev, 0); } acpi_bus_generate_proc_event(device, event, ++button->pushed);