diff options
author | Len Brown <len.brown@intel.com> | 2010-08-15 06:25:40 +0200 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2010-08-15 06:25:40 +0200 |
commit | c172cb73bc79fe69915b1a1a48e374aa4b1f8a59 (patch) | |
tree | eb3d6415914968441c063f7282e824b14b5a5edb /drivers/acpi/wakeup.c | |
parent | Merge branch 'bugzilla-16422' into release (diff) | |
parent | ACPI / ACPICA: Fix reference counting problems with GPE handlers (diff) | |
download | linux-c172cb73bc79fe69915b1a1a48e374aa4b1f8a59.tar.xz linux-c172cb73bc79fe69915b1a1a48e374aa4b1f8a59.zip |
Merge branch 'acpica-gpe' into release
Diffstat (limited to 'drivers/acpi/wakeup.c')
-rw-r--r-- | drivers/acpi/wakeup.c | 18 |
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); } } |