aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/wakeup.c
diff options
context:
space:
mode:
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)
36 struct acpi_device *dev = 36 struct acpi_device *dev =
37 container_of(node, struct acpi_device, wakeup_list); 37 container_of(node, struct acpi_device, wakeup_list);
38 38
39 if (!dev->wakeup.flags.valid || !dev->wakeup.state.enabled 39 if (!dev->wakeup.flags.valid
40 || !(dev->wakeup.state.enabled || dev->wakeup.prepare_count)
40 || sleep_state > (u32) dev->wakeup.sleep_state) 41 || sleep_state > (u32) dev->wakeup.sleep_state)
41 continue; 42 continue;
42 43
@@ -44,8 +45,8 @@ void acpi_enable_wakeup_devices(u8 sleep_state)
44 acpi_enable_wakeup_device_power(dev, sleep_state); 45 acpi_enable_wakeup_device_power(dev, sleep_state);
45 46
46 /* The wake-up power should have been enabled already. */ 47 /* The wake-up power should have been enabled already. */
47 acpi_enable_gpe(dev->wakeup.gpe_device, dev->wakeup.gpe_number, 48 acpi_gpe_wakeup(dev->wakeup.gpe_device, dev->wakeup.gpe_number,
48 ACPI_GPE_TYPE_WAKE); 49 ACPI_GPE_ENABLE);
49 } 50 }
50} 51}
51 52
@@ -61,13 +62,16 @@ void acpi_disable_wakeup_devices(u8 sleep_state)
61 struct acpi_device *dev = 62 struct acpi_device *dev =
62 container_of(node, struct acpi_device, wakeup_list); 63 container_of(node, struct acpi_device, wakeup_list);
63 64
64 if (!dev->wakeup.flags.valid || !dev->wakeup.state.enabled 65 if (!dev->wakeup.flags.valid
66 || !(dev->wakeup.state.enabled || dev->wakeup.prepare_count)
65 || (sleep_state > (u32) dev->wakeup.sleep_state)) 67 || (sleep_state > (u32) dev->wakeup.sleep_state))
66 continue; 68 continue;
67 69
68 acpi_disable_gpe(dev->wakeup.gpe_device, dev->wakeup.gpe_number, 70 acpi_gpe_wakeup(dev->wakeup.gpe_device, dev->wakeup.gpe_number,
69 ACPI_GPE_TYPE_WAKE); 71 ACPI_GPE_DISABLE);
70 acpi_disable_wakeup_device_power(dev); 72
73 if (dev->wakeup.state.enabled)
74 acpi_disable_wakeup_device_power(dev);
71 } 75 }
72} 76}
73 77