aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/hardware/hwsleep.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-10-23 13:20:36 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-23 13:20:36 -0400
commit765426e8ee4c0ab2bc9d44951f4865b8494cdbd0 (patch)
tree2b46ab8953eff175c8d3474a9754c1ab1394e4de /drivers/acpi/hardware/hwsleep.c
parent36ec891895020f3bc9953c8b11d079c6d77d76bd (diff)
parent898b054f3eec5921320ae8614b5bdd7b07ea5b43 (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: (123 commits) dock: make dock driver not a module ACPI: fix ia64 build warning ACPI: hack around sysfs warning with link order ACPI suspend: fix build warning when CONFIG_ACPI_SLEEP=n intel_menlo: fix build warning panasonic-laptop: fix build ACPICA: Update version to 20080926 ACPICA: Add support for zero-length buffer-to-string conversions ACPICA: New: Validation for predefined ACPI methods/objects ACPICA: Fix for implicit return compatibility ACPICA: Fixed a couple memory leaks associated with "implicit return" ACPICA: Optimize buffer allocation procedure ACPICA: Fix possible memory leak, error exit path ACPICA: Fix fault after mem allocation failure in AML parser ACPICA: Remove unused ACPI register bit definition ACPICA: Update version to 20080829 ACPICA: Fix possible memory leak in acpi_ns_get_external_pathname ACPICA: Cleanup for internal Reference Object ACPICA: Update comments - no functional changes ACPICA: Update for Reference ACPI_OPERAND_OBJECT ...
Diffstat (limited to 'drivers/acpi/hardware/hwsleep.c')
-rw-r--r--drivers/acpi/hardware/hwsleep.c44
1 files changed, 18 insertions, 26 deletions
diff --git a/drivers/acpi/hardware/hwsleep.c b/drivers/acpi/hardware/hwsleep.c
index dba3cfbe8cba..25dccdf179b9 100644
--- a/drivers/acpi/hardware/hwsleep.c
+++ b/drivers/acpi/hardware/hwsleep.c
@@ -78,19 +78,17 @@ acpi_set_firmware_waking_vector(acpi_physical_address physical_address)
78 return_ACPI_STATUS(status); 78 return_ACPI_STATUS(status);
79 } 79 }
80 80
81 /* Set the vector */ 81 /*
82 * According to the ACPI specification 2.0c and later, the 64-bit
83 * waking vector should be cleared and the 32-bit waking vector should
84 * be used, unless we want the wake-up code to be called by the BIOS in
85 * Protected Mode. Some systems (for example HP dv5-1004nr) are known
86 * to fail to resume if the 64-bit vector is used.
87 */
88 if (facs->version >= 1)
89 facs->xfirmware_waking_vector = 0;
82 90
83 if ((facs->length < 32) || (!(facs->xfirmware_waking_vector))) { 91 facs->firmware_waking_vector = (u32)physical_address;
84 /*
85 * ACPI 1.0 FACS or short table or optional X_ field is zero
86 */
87 facs->firmware_waking_vector = (u32) physical_address;
88 } else {
89 /*
90 * ACPI 2.0 FACS with valid X_ field
91 */
92 facs->xfirmware_waking_vector = physical_address;
93 }
94 92
95 return_ACPI_STATUS(AE_OK); 93 return_ACPI_STATUS(AE_OK);
96} 94}
@@ -134,20 +132,7 @@ acpi_get_firmware_waking_vector(acpi_physical_address * physical_address)
134 } 132 }
135 133
136 /* Get the vector */ 134 /* Get the vector */
137 135 *physical_address = (acpi_physical_address)facs->firmware_waking_vector;
138 if ((facs->length < 32) || (!(facs->xfirmware_waking_vector))) {
139 /*
140 * ACPI 1.0 FACS or short table or optional X_ field is zero
141 */
142 *physical_address =
143 (acpi_physical_address) facs->firmware_waking_vector;
144 } else {
145 /*
146 * ACPI 2.0 FACS with valid X_ field
147 */
148 *physical_address =
149 (acpi_physical_address) facs->xfirmware_waking_vector;
150 }
151 136
152 return_ACPI_STATUS(AE_OK); 137 return_ACPI_STATUS(AE_OK);
153} 138}
@@ -627,6 +612,13 @@ acpi_status acpi_leave_sleep_state(u8 sleep_state)
627 } 612 }
628 /* TBD: _WAK "sometimes" returns stuff - do we want to look at it? */ 613 /* TBD: _WAK "sometimes" returns stuff - do we want to look at it? */
629 614
615 /*
616 * Some BIOSes assume that WAK_STS will be cleared on resume and use
617 * it to determine whether the system is rebooting or resuming. Clear
618 * it for compatibility.
619 */
620 acpi_set_register(ACPI_BITREG_WAKE_STATUS, 1);
621
630 acpi_gbl_system_awake_and_running = TRUE; 622 acpi_gbl_system_awake_and_running = TRUE;
631 623
632 /* Enable power button */ 624 /* Enable power button */