summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/wakeup.c
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2010-08-15 00:25:40 -0400
committerLen Brown <len.brown@intel.com>2010-08-15 00:25:40 -0400
commitc172cb73bc79fe69915b1a1a48e374aa4b1f8a59 (patch)
treeeb3d6415914968441c063f7282e824b14b5a5edb /drivers/acpi/wakeup.c
parente8eb6228094bcf0c84d9aa32b6363e78da68e1f5 (diff)
parent28f4f8a9def2b1f3a6066bae791c77043ec49524 (diff)
downloadlinux-c172cb73bc79fe69915b1a1a48e374aa4b1f8a59.tar.bz2
Merge branch 'acpica-gpe' into release
Diffstat (limited to 'drivers/acpi/wakeup.c')
-rw-r--r--drivers/acpi/wakeup.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/drivers/acpi/wakeup.c b/drivers/acpi/wakeup.c
index dc6d1d9112fb..f62a50c3ed34 100644
--- a/drivers/acpi/wakeup.c
+++ b/drivers/acpi/wakeup.c
@@ -36,7 +36,8 @@ void acpi_enable_wakeup_devices(u8 sleep_state)
struct acpi_device *dev =
container_of(node, struct acpi_device, wakeup_list);
- if (!dev->wakeup.flags.valid || !dev->wakeup.state.enabled
+ if (!dev->wakeup.flags.valid
+ || !(dev->wakeup.state.enabled || dev->wakeup.prepare_count)
|| sleep_state > (u32) dev->wakeup.sleep_state)
continue;
@@ -44,8 +45,8 @@ void acpi_enable_wakeup_devices(u8 sleep_state)
acpi_enable_wakeup_device_power(dev, sleep_state);
/* The wake-up power should have been enabled already. */
- acpi_enable_gpe(dev->wakeup.gpe_device, dev->wakeup.gpe_number,
- ACPI_GPE_TYPE_WAKE);
+ acpi_gpe_wakeup(dev->wakeup.gpe_device, dev->wakeup.gpe_number,
+ ACPI_GPE_ENABLE);
}
}
@@ -61,13 +62,16 @@ void acpi_disable_wakeup_devices(u8 sleep_state)
struct acpi_device *dev =
container_of(node, struct acpi_device, wakeup_list);
- if (!dev->wakeup.flags.valid || !dev->wakeup.state.enabled
+ if (!dev->wakeup.flags.valid
+ || !(dev->wakeup.state.enabled || dev->wakeup.prepare_count)
|| (sleep_state > (u32) dev->wakeup.sleep_state))
continue;
- acpi_disable_gpe(dev->wakeup.gpe_device, dev->wakeup.gpe_number,
- ACPI_GPE_TYPE_WAKE);
- acpi_disable_wakeup_device_power(dev);
+ acpi_gpe_wakeup(dev->wakeup.gpe_device, dev->wakeup.gpe_number,
+ ACPI_GPE_DISABLE);
+
+ if (dev->wakeup.state.enabled)
+ acpi_disable_wakeup_device_power(dev);
}
}