aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/wakeup.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-08-15 20:37:07 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-15 20:37:07 -0400
commit2245ba2a3a975656bb303dfaa115accaa4667083 (patch)
treecbeb348c43d58461d851907373c34a7b9a985e41 /drivers/acpi/wakeup.c
parente2e96c663639a3361bb1a84e666887d308c6c87e (diff)
parent95ee46aa8698f2000647dfb362400fadbb5807cf (diff)
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: gcc-4.6: ACPI: fix unused but set variables in ACPI ACPI thermal: make procfs I/F depend on CONFIG_ACPI_PROCFS ACPI video: make procfs I/F depend on CONFIG_ACPI_PROCFS ACPI processor: remove deprecated ACPI procfs I/F ACPI power_resource: remove unused procfs I/F ACPI: remove deprecated ACPI procfs I/F ACPI: introduce drivers/acpi/sysfs.c ACPI: introduce module parameter acpi.aml_debug_output ACPI: introduce drivers/acpi/debugfs.c ACPI, APEI, ERST debug support ACPI, APEI, Manage GHES as platform devices ACPI, APEI, Rename CPER and GHES severity constants ACPI, APEI, Fix a typo of error path of apei_resources_request ACPI / ACPICA: Fix reference counting problems with GPE handlers ACPI: Add the check of ADR flag in course of finding ACPI handle for PCI device ACPI / Sleep: Drop acpi_suspend_finish() ACPI / Sleep: Consolidate suspend and hibernation routines ACPI / Wakeup: Simplify enabling of wakeup devices ACPI / Sleep: Rework enabling wakeup devices ACPI / Sleep: Free NVS copy if suspending of devices fails Fixed up totally buggered "ACPI: fix unused but set variables in ACPI" patch that doesn't even compile in the merge. Thanks to Sedat Dilek <sedat.dilek@googlemail.com> for noticing the breakage before I even pulled. And a big "Grrr.." at Len for not even bothering to compile the tree before asking me to pull.
Diffstat (limited to 'drivers/acpi/wakeup.c')
-rw-r--r--drivers/acpi/wakeup.c48
1 files changed, 10 insertions, 38 deletions
diff --git a/drivers/acpi/wakeup.c b/drivers/acpi/wakeup.c
index c80537bc3234..f62a50c3ed34 100644
--- a/drivers/acpi/wakeup.c
+++ b/drivers/acpi/wakeup.c
@@ -21,46 +21,18 @@
21ACPI_MODULE_NAME("wakeup_devices") 21ACPI_MODULE_NAME("wakeup_devices")
22 22
23/** 23/**
24 * acpi_enable_wakeup_device_prep - Prepare wake-up devices. 24 * acpi_enable_wakeup_devices - Enable wake-up device GPEs.
25 * @sleep_state: ACPI system sleep state. 25 * @sleep_state: ACPI system sleep state.
26 * 26 *
27 * Enable all wake-up devices' power, unless the requested system sleep state is 27 * Enable wakeup device power of devices with the state.enable flag set and set
28 * too deep. 28 * the wakeup enable mask bits in the GPE registers that correspond to wakeup
29 * devices.
29 */ 30 */
30void acpi_enable_wakeup_device_prep(u8 sleep_state) 31void acpi_enable_wakeup_devices(u8 sleep_state)
31{ 32{
32 struct list_head *node, *next; 33 struct list_head *node, *next;
33 34
34 list_for_each_safe(node, next, &acpi_wakeup_device_list) { 35 list_for_each_safe(node, next, &acpi_wakeup_device_list) {
35 struct acpi_device *dev = container_of(node,
36 struct acpi_device,
37 wakeup_list);
38
39 if (!dev->wakeup.flags.valid || !dev->wakeup.state.enabled
40 || (sleep_state > (u32) dev->wakeup.sleep_state))
41 continue;
42
43 acpi_enable_wakeup_device_power(dev, sleep_state);
44 }
45}
46
47/**
48 * acpi_enable_wakeup_device - Enable wake-up device GPEs.
49 * @sleep_state: ACPI system sleep state.
50 *
51 * Enable all wake-up devices' GPEs, with the assumption that
52 * acpi_disable_all_gpes() was executed before, so we don't need to disable any
53 * GPEs here.
54 */
55void acpi_enable_wakeup_device(u8 sleep_state)
56{
57 struct list_head *node, *next;
58
59 /*
60 * Caution: this routine must be invoked when interrupt is disabled
61 * Refer ACPI2.0: P212
62 */
63 list_for_each_safe(node, next, &acpi_wakeup_device_list) {
64 struct acpi_device *dev = 36 struct acpi_device *dev =
65 container_of(node, struct acpi_device, wakeup_list); 37 container_of(node, struct acpi_device, wakeup_list);
66 38
@@ -69,6 +41,9 @@ void acpi_enable_wakeup_device(u8 sleep_state)
69 || sleep_state > (u32) dev->wakeup.sleep_state) 41 || sleep_state > (u32) dev->wakeup.sleep_state)
70 continue; 42 continue;
71 43
44 if (dev->wakeup.state.enabled)
45 acpi_enable_wakeup_device_power(dev, sleep_state);
46
72 /* The wake-up power should have been enabled already. */ 47 /* The wake-up power should have been enabled already. */
73 acpi_gpe_wakeup(dev->wakeup.gpe_device, dev->wakeup.gpe_number, 48 acpi_gpe_wakeup(dev->wakeup.gpe_device, dev->wakeup.gpe_number,
74 ACPI_GPE_ENABLE); 49 ACPI_GPE_ENABLE);
@@ -76,13 +51,10 @@ void acpi_enable_wakeup_device(u8 sleep_state)
76} 51}
77 52
78/** 53/**
79 * acpi_disable_wakeup_device - Disable devices' wakeup capability. 54 * acpi_disable_wakeup_devices - Disable devices' wakeup capability.
80 * @sleep_state: ACPI system sleep state. 55 * @sleep_state: ACPI system sleep state.
81 *
82 * This function only affects devices with wakeup.state.enabled set, which means
83 * that it reverses the changes made by acpi_enable_wakeup_device_prep().
84 */ 56 */
85void acpi_disable_wakeup_device(u8 sleep_state) 57void acpi_disable_wakeup_devices(u8 sleep_state)
86{ 58{
87 struct list_head *node, *next; 59 struct list_head *node, *next;
88 60