aboutsummaryrefslogtreecommitdiff
path: root/drivers/acpi/sleep/wakeup.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-07-17 23:57:20 +0200
committerIngo Molnar <mingo@elte.hu>2008-07-17 23:57:20 +0200
commit393d81aa026e19b6ede6f5f11955c97ee62e5df5 (patch)
treea1d9511e488e19d41089ff0a736f6ce52a81c6e5 /drivers/acpi/sleep/wakeup.c
parent93a0886e2368eafb9df5e2021fb185195cee88b2 (diff)
parent5b664cb235e97afbf34db9c4d77f08ebd725335e (diff)
Merge branch 'linus' into xen-64bit
Diffstat (limited to 'drivers/acpi/sleep/wakeup.c')
-rw-r--r--drivers/acpi/sleep/wakeup.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/acpi/sleep/wakeup.c b/drivers/acpi/sleep/wakeup.c
index ed8e41becf0..38655eb132d 100644
--- a/drivers/acpi/sleep/wakeup.c
+++ b/drivers/acpi/sleep/wakeup.c
@@ -42,7 +42,7 @@ void acpi_enable_wakeup_device_prep(u8 sleep_state)
continue;
spin_unlock(&acpi_device_lock);
- acpi_enable_wakeup_device_power(dev);
+ acpi_enable_wakeup_device_power(dev, sleep_state);
spin_lock(&acpi_device_lock);
}
spin_unlock(&acpi_device_lock);
@@ -66,13 +66,15 @@ void acpi_enable_wakeup_device(u8 sleep_state)
list_for_each_safe(node, next, &acpi_wakeup_device_list) {
struct acpi_device *dev =
container_of(node, struct acpi_device, wakeup_list);
+
if (!dev->wakeup.flags.valid)
continue;
+
/* If users want to disable run-wake GPE,
* we only disable it for wake and leave it for runtime
*/
- if (!dev->wakeup.state.enabled ||
- sleep_state > (u32) dev->wakeup.sleep_state) {
+ if ((!dev->wakeup.state.enabled && !dev->wakeup.flags.prepared)
+ || sleep_state > (u32) dev->wakeup.sleep_state) {
if (dev->wakeup.flags.run_wake) {
spin_unlock(&acpi_device_lock);
/* set_gpe_type will disable GPE, leave it like that */
@@ -110,8 +112,9 @@ void acpi_disable_wakeup_device(u8 sleep_state)
if (!dev->wakeup.flags.valid)
continue;
- if (!dev->wakeup.state.enabled ||
- sleep_state > (u32) dev->wakeup.sleep_state) {
+
+ if ((!dev->wakeup.state.enabled && !dev->wakeup.flags.prepared)
+ || sleep_state > (u32) dev->wakeup.sleep_state) {
if (dev->wakeup.flags.run_wake) {
spin_unlock(&acpi_device_lock);
acpi_set_gpe_type(dev->wakeup.gpe_device,