diff options
author | Len Brown <len.brown@intel.com> | 2011-01-12 10:55:46 +0100 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2011-01-12 10:55:46 +0100 |
commit | fb4af417cce9ff87abf33a6bb9a0cf613e285364 (patch) | |
tree | 328ce710c6e6acf7b58145da939fb3cc91d188c9 /drivers/acpi/wakeup.c | |
parent | Merge branch 'power-resource' into release (diff) | |
parent | ACPI / PM: Blacklist Averatec machine known to require acpi_sleep=nonvs (diff) | |
download | linux-fb4af417cce9ff87abf33a6bb9a0cf613e285364.tar.xz linux-fb4af417cce9ff87abf33a6bb9a0cf613e285364.zip |
Merge branch 'wakeup-etc-rafael' into release
Diffstat (limited to 'drivers/acpi/wakeup.c')
-rw-r--r-- | drivers/acpi/wakeup.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/acpi/wakeup.c b/drivers/acpi/wakeup.c index c6cb68e0a80c..ed6501452507 100644 --- a/drivers/acpi/wakeup.c +++ b/drivers/acpi/wakeup.c @@ -37,11 +37,12 @@ void acpi_enable_wakeup_devices(u8 sleep_state) container_of(node, struct acpi_device, wakeup_list); if (!dev->wakeup.flags.valid - || !(dev->wakeup.state.enabled || dev->wakeup.prepare_count) - || sleep_state > (u32) dev->wakeup.sleep_state) + || sleep_state > (u32) dev->wakeup.sleep_state + || !(device_may_wakeup(&dev->dev) + || dev->wakeup.prepare_count)) continue; - if (dev->wakeup.state.enabled) + if (device_may_wakeup(&dev->dev)) acpi_enable_wakeup_device_power(dev, sleep_state); /* The wake-up power should have been enabled already. */ @@ -63,14 +64,15 @@ void acpi_disable_wakeup_devices(u8 sleep_state) container_of(node, struct acpi_device, wakeup_list); if (!dev->wakeup.flags.valid - || !(dev->wakeup.state.enabled || dev->wakeup.prepare_count) - || (sleep_state > (u32) dev->wakeup.sleep_state)) + || sleep_state > (u32) dev->wakeup.sleep_state + || !(device_may_wakeup(&dev->dev) + || dev->wakeup.prepare_count)) continue; acpi_set_gpe_wake_mask(dev->wakeup.gpe_device, dev->wakeup.gpe_number, ACPI_GPE_DISABLE); - if (dev->wakeup.state.enabled) + if (device_may_wakeup(&dev->dev)) acpi_disable_wakeup_device_power(dev); } } @@ -84,8 +86,8 @@ int __init acpi_wakeup_device_init(void) struct acpi_device *dev = container_of(node, struct acpi_device, wakeup_list); - if (dev->wakeup.flags.always_enabled) - dev->wakeup.state.enabled = 1; + if (device_can_wakeup(&dev->dev)) + device_set_wakeup_enable(&dev->dev, true); } mutex_unlock(&acpi_device_lock); return 0; |