[PATCH 4/4] ACPI / PM: Report wakeup events from buttons

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Rafael J. Wysocki
Date: Tuesday, December 28, 2010 - 8:31 am

From: Rafael J. Wysocki <rjw@sisk.pl>

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 <rjw@sisk.pl>
---
 drivers/acpi/button.c |    5 +++++
 1 file changed, 5 insertions(+)

Index: linux-2.6/drivers/acpi/button.c
===================================================================
--- linux-2.6.orig/drivers/acpi/button.c
+++ linux-2.6/drivers/acpi/button.c
@@ -279,6 +279,9 @@ static int acpi_lid_send_state(struct ac
 	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 ac
 			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);

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/4] ACPI / PM: Use standard device wakeup faciliti ..., Rafael J. Wysocki, (Tue Dec 28, 8:25 am)
[PATCH 1/4] ACPI / PM: Do not enable multiple devices to w ..., Rafael J. Wysocki, (Tue Dec 28, 8:28 am)
[PATCH 2/4] ACPI / PM: Use device wakeup flags for handlin ..., Rafael J. Wysocki, (Tue Dec 28, 8:29 am)
[PATCH 3/4] ACPI / PM: Drop special ACPI wakeup flags, Rafael J. Wysocki, (Tue Dec 28, 8:30 am)
[PATCH 4/4] ACPI / PM: Report wakeup events from buttons, Rafael J. Wysocki, (Tue Dec 28, 8:31 am)