Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | |
| 2 | /****************************************************************************** |
| 3 | * |
| 4 | * Name: hwsleep.c - ACPI Hardware Sleep/Wake Interface |
| 5 | * |
| 6 | *****************************************************************************/ |
| 7 | |
| 8 | /* |
Bob Moore | 4a90c7e | 2006-01-13 16:22:00 -0500 | [diff] [blame] | 9 | * Copyright (C) 2000 - 2006, R. Byron Moore |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 10 | * All rights reserved. |
| 11 | * |
| 12 | * Redistribution and use in source and binary forms, with or without |
| 13 | * modification, are permitted provided that the following conditions |
| 14 | * are met: |
| 15 | * 1. Redistributions of source code must retain the above copyright |
| 16 | * notice, this list of conditions, and the following disclaimer, |
| 17 | * without modification. |
| 18 | * 2. Redistributions in binary form must reproduce at minimum a disclaimer |
| 19 | * substantially similar to the "NO WARRANTY" disclaimer below |
| 20 | * ("Disclaimer") and any redistribution must be conditioned upon |
| 21 | * including a substantially similar Disclaimer requirement for further |
| 22 | * binary redistribution. |
| 23 | * 3. Neither the names of the above-listed copyright holders nor the names |
| 24 | * of any contributors may be used to endorse or promote products derived |
| 25 | * from this software without specific prior written permission. |
| 26 | * |
| 27 | * Alternatively, this software may be distributed under the terms of the |
| 28 | * GNU General Public License ("GPL") version 2 as published by the Free |
| 29 | * Software Foundation. |
| 30 | * |
| 31 | * NO WARRANTY |
| 32 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 33 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 34 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR |
| 35 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 36 | * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 37 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
| 38 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
| 39 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, |
| 40 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING |
| 41 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 42 | * POSSIBILITY OF SUCH DAMAGES. |
| 43 | */ |
| 44 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 45 | #include <acpi/acpi.h> |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 46 | #include <acpi/actables.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 47 | |
| 48 | #define _COMPONENT ACPI_HARDWARE |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 49 | ACPI_MODULE_NAME("hwsleep") |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 50 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 51 | /******************************************************************************* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 52 | * |
| 53 | * FUNCTION: acpi_set_firmware_waking_vector |
| 54 | * |
| 55 | * PARAMETERS: physical_address - Physical address of ACPI real mode |
| 56 | * entry point. |
| 57 | * |
| 58 | * RETURN: Status |
| 59 | * |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 60 | * DESCRIPTION: Access function for the firmware_waking_vector field in FACS |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 61 | * |
| 62 | ******************************************************************************/ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 63 | acpi_status |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 64 | acpi_set_firmware_waking_vector(acpi_physical_address physical_address) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 65 | { |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 66 | struct acpi_table_facs *facs; |
| 67 | acpi_status status; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 68 | |
Bob Moore | b229cf9 | 2006-04-21 17:15:00 -0400 | [diff] [blame] | 69 | ACPI_FUNCTION_TRACE(acpi_set_firmware_waking_vector); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 70 | |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 71 | /* Get the FACS */ |
| 72 | |
| 73 | status = |
| 74 | acpi_get_table_by_index(ACPI_TABLE_INDEX_FACS, |
| 75 | (struct acpi_table_header **)&facs); |
| 76 | if (ACPI_FAILURE(status)) { |
| 77 | return_ACPI_STATUS(status); |
| 78 | } |
| 79 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 80 | /* Set the vector */ |
| 81 | |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 82 | if ((facs->length < 32) || (!(facs->xfirmware_waking_vector))) { |
| 83 | /* |
| 84 | * ACPI 1.0 FACS or short table or optional X_ field is zero |
| 85 | */ |
| 86 | facs->firmware_waking_vector = (u32) physical_address; |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 87 | } else { |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 88 | /* |
| 89 | * ACPI 2.0 FACS with valid X_ field |
| 90 | */ |
| 91 | facs->xfirmware_waking_vector = physical_address; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 92 | } |
| 93 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 94 | return_ACPI_STATUS(AE_OK); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 95 | } |
| 96 | |
Bob Moore | 8313524 | 2006-10-03 00:00:00 -0400 | [diff] [blame] | 97 | ACPI_EXPORT_SYMBOL(acpi_set_firmware_waking_vector) |
| 98 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 99 | /******************************************************************************* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 100 | * |
| 101 | * FUNCTION: acpi_get_firmware_waking_vector |
| 102 | * |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 103 | * PARAMETERS: *physical_address - Where the contents of |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 104 | * the firmware_waking_vector field of |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 105 | * the FACS will be returned. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 106 | * |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 107 | * RETURN: Status, vector |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 108 | * |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 109 | * DESCRIPTION: Access function for the firmware_waking_vector field in FACS |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 110 | * |
| 111 | ******************************************************************************/ |
| 112 | #ifdef ACPI_FUTURE_USAGE |
| 113 | acpi_status |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 114 | acpi_get_firmware_waking_vector(acpi_physical_address * physical_address) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 115 | { |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 116 | struct acpi_table_facs *facs; |
| 117 | acpi_status status; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 118 | |
Bob Moore | b229cf9 | 2006-04-21 17:15:00 -0400 | [diff] [blame] | 119 | ACPI_FUNCTION_TRACE(acpi_get_firmware_waking_vector); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 120 | |
| 121 | if (!physical_address) { |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 122 | return_ACPI_STATUS(AE_BAD_PARAMETER); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 123 | } |
| 124 | |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 125 | /* Get the FACS */ |
| 126 | |
| 127 | status = |
| 128 | acpi_get_table_by_index(ACPI_TABLE_INDEX_FACS, |
| 129 | (struct acpi_table_header **)&facs); |
| 130 | if (ACPI_FAILURE(status)) { |
| 131 | return_ACPI_STATUS(status); |
| 132 | } |
| 133 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 134 | /* Get the vector */ |
| 135 | |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 136 | if ((facs->length < 32) || (!(facs->xfirmware_waking_vector))) { |
| 137 | /* |
| 138 | * ACPI 1.0 FACS or short table or optional X_ field is zero |
| 139 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 140 | *physical_address = |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 141 | (acpi_physical_address) facs->firmware_waking_vector; |
| 142 | } else { |
| 143 | /* |
| 144 | * ACPI 2.0 FACS with valid X_ field |
| 145 | */ |
| 146 | *physical_address = |
| 147 | (acpi_physical_address) facs->xfirmware_waking_vector; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 148 | } |
| 149 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 150 | return_ACPI_STATUS(AE_OK); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 151 | } |
Bob Moore | 8313524 | 2006-10-03 00:00:00 -0400 | [diff] [blame] | 152 | |
| 153 | ACPI_EXPORT_SYMBOL(acpi_get_firmware_waking_vector) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 154 | #endif |
| 155 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 156 | /******************************************************************************* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 157 | * |
| 158 | * FUNCTION: acpi_enter_sleep_state_prep |
| 159 | * |
| 160 | * PARAMETERS: sleep_state - Which sleep state to enter |
| 161 | * |
| 162 | * RETURN: Status |
| 163 | * |
| 164 | * DESCRIPTION: Prepare to enter a system sleep state (see ACPI 2.0 spec p 231) |
| 165 | * This function must execute with interrupts enabled. |
| 166 | * We break sleeping into 2 stages so that OSPM can handle |
| 167 | * various OS-specific tasks between the two steps. |
| 168 | * |
| 169 | ******************************************************************************/ |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 170 | acpi_status acpi_enter_sleep_state_prep(u8 sleep_state) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 171 | { |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 172 | acpi_status status; |
| 173 | struct acpi_object_list arg_list; |
| 174 | union acpi_object arg; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 175 | |
Bob Moore | b229cf9 | 2006-04-21 17:15:00 -0400 | [diff] [blame] | 176 | ACPI_FUNCTION_TRACE(acpi_enter_sleep_state_prep); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 177 | |
| 178 | /* |
| 179 | * _PSW methods could be run here to enable wake-on keyboard, LAN, etc. |
| 180 | */ |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 181 | status = acpi_get_sleep_type_data(sleep_state, |
| 182 | &acpi_gbl_sleep_type_a, |
| 183 | &acpi_gbl_sleep_type_b); |
| 184 | if (ACPI_FAILURE(status)) { |
| 185 | return_ACPI_STATUS(status); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 186 | } |
| 187 | |
| 188 | /* Setup parameter object */ |
| 189 | |
| 190 | arg_list.count = 1; |
| 191 | arg_list.pointer = &arg; |
| 192 | |
| 193 | arg.type = ACPI_TYPE_INTEGER; |
| 194 | arg.integer.value = sleep_state; |
| 195 | |
| 196 | /* Run the _PTS and _GTS methods */ |
| 197 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 198 | status = acpi_evaluate_object(NULL, METHOD_NAME__PTS, &arg_list, NULL); |
| 199 | if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) { |
| 200 | return_ACPI_STATUS(status); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 201 | } |
| 202 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 203 | status = acpi_evaluate_object(NULL, METHOD_NAME__GTS, &arg_list, NULL); |
| 204 | if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) { |
| 205 | return_ACPI_STATUS(status); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 206 | } |
| 207 | |
| 208 | /* Setup the argument to _SST */ |
| 209 | |
| 210 | switch (sleep_state) { |
| 211 | case ACPI_STATE_S0: |
| 212 | arg.integer.value = ACPI_SST_WORKING; |
| 213 | break; |
| 214 | |
| 215 | case ACPI_STATE_S1: |
| 216 | case ACPI_STATE_S2: |
| 217 | case ACPI_STATE_S3: |
| 218 | arg.integer.value = ACPI_SST_SLEEPING; |
| 219 | break; |
| 220 | |
| 221 | case ACPI_STATE_S4: |
| 222 | arg.integer.value = ACPI_SST_SLEEP_CONTEXT; |
| 223 | break; |
| 224 | |
| 225 | default: |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 226 | arg.integer.value = ACPI_SST_INDICATOR_OFF; /* Default is off */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 227 | break; |
| 228 | } |
| 229 | |
| 230 | /* Set the system indicators to show the desired sleep state. */ |
| 231 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 232 | status = acpi_evaluate_object(NULL, METHOD_NAME__SST, &arg_list, NULL); |
| 233 | if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) { |
Bob Moore | b8e4d89 | 2006-01-27 16:43:00 -0500 | [diff] [blame] | 234 | ACPI_EXCEPTION((AE_INFO, status, |
| 235 | "While executing method _SST")); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 236 | } |
| 237 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 238 | return_ACPI_STATUS(AE_OK); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 239 | } |
| 240 | |
Bob Moore | 8313524 | 2006-10-03 00:00:00 -0400 | [diff] [blame] | 241 | ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state_prep) |
| 242 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 243 | /******************************************************************************* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 244 | * |
| 245 | * FUNCTION: acpi_enter_sleep_state |
| 246 | * |
| 247 | * PARAMETERS: sleep_state - Which sleep state to enter |
| 248 | * |
| 249 | * RETURN: Status |
| 250 | * |
| 251 | * DESCRIPTION: Enter a system sleep state (see ACPI 2.0 spec p 231) |
| 252 | * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED |
| 253 | * |
| 254 | ******************************************************************************/ |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 255 | acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 256 | { |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 257 | u32 PM1Acontrol; |
| 258 | u32 PM1Bcontrol; |
| 259 | struct acpi_bit_register_info *sleep_type_reg_info; |
| 260 | struct acpi_bit_register_info *sleep_enable_reg_info; |
| 261 | u32 in_value; |
| 262 | acpi_status status; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 263 | |
Bob Moore | b229cf9 | 2006-04-21 17:15:00 -0400 | [diff] [blame] | 264 | ACPI_FUNCTION_TRACE(acpi_enter_sleep_state); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 265 | |
| 266 | if ((acpi_gbl_sleep_type_a > ACPI_SLEEP_TYPE_MAX) || |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 267 | (acpi_gbl_sleep_type_b > ACPI_SLEEP_TYPE_MAX)) { |
Bob Moore | b8e4d89 | 2006-01-27 16:43:00 -0500 | [diff] [blame] | 268 | ACPI_ERROR((AE_INFO, "Sleep values out of range: A=%X B=%X", |
| 269 | acpi_gbl_sleep_type_a, acpi_gbl_sleep_type_b)); |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 270 | return_ACPI_STATUS(AE_AML_OPERAND_VALUE); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 271 | } |
| 272 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 273 | sleep_type_reg_info = |
| 274 | acpi_hw_get_bit_register_info(ACPI_BITREG_SLEEP_TYPE_A); |
| 275 | sleep_enable_reg_info = |
| 276 | acpi_hw_get_bit_register_info(ACPI_BITREG_SLEEP_ENABLE); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 277 | |
| 278 | /* Clear wake status */ |
| 279 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 280 | status = |
| 281 | acpi_set_register(ACPI_BITREG_WAKE_STATUS, 1, ACPI_MTX_DO_NOT_LOCK); |
| 282 | if (ACPI_FAILURE(status)) { |
| 283 | return_ACPI_STATUS(status); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 284 | } |
| 285 | |
| 286 | /* Clear all fixed and general purpose status bits */ |
| 287 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 288 | status = acpi_hw_clear_acpi_status(ACPI_MTX_DO_NOT_LOCK); |
| 289 | if (ACPI_FAILURE(status)) { |
| 290 | return_ACPI_STATUS(status); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 291 | } |
| 292 | |
| 293 | /* |
| 294 | * 1) Disable/Clear all GPEs |
| 295 | * 2) Enable all wakeup GPEs |
| 296 | */ |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 297 | status = acpi_hw_disable_all_gpes(); |
| 298 | if (ACPI_FAILURE(status)) { |
| 299 | return_ACPI_STATUS(status); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 300 | } |
| 301 | acpi_gbl_system_awake_and_running = FALSE; |
| 302 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 303 | status = acpi_hw_enable_all_wakeup_gpes(); |
| 304 | if (ACPI_FAILURE(status)) { |
| 305 | return_ACPI_STATUS(status); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 306 | } |
| 307 | |
| 308 | /* Get current value of PM1A control */ |
| 309 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 310 | status = acpi_hw_register_read(ACPI_MTX_DO_NOT_LOCK, |
| 311 | ACPI_REGISTER_PM1_CONTROL, &PM1Acontrol); |
| 312 | if (ACPI_FAILURE(status)) { |
| 313 | return_ACPI_STATUS(status); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 314 | } |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 315 | ACPI_DEBUG_PRINT((ACPI_DB_INIT, |
| 316 | "Entering sleep state [S%d]\n", sleep_state)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 317 | |
| 318 | /* Clear SLP_EN and SLP_TYP fields */ |
| 319 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 320 | PM1Acontrol &= ~(sleep_type_reg_info->access_bit_mask | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 321 | sleep_enable_reg_info->access_bit_mask); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 322 | PM1Bcontrol = PM1Acontrol; |
| 323 | |
| 324 | /* Insert SLP_TYP bits */ |
| 325 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 326 | PM1Acontrol |= |
| 327 | (acpi_gbl_sleep_type_a << sleep_type_reg_info->bit_position); |
| 328 | PM1Bcontrol |= |
| 329 | (acpi_gbl_sleep_type_b << sleep_type_reg_info->bit_position); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 330 | |
| 331 | /* |
| 332 | * We split the writes of SLP_TYP and SLP_EN to workaround |
| 333 | * poorly implemented hardware. |
| 334 | */ |
| 335 | |
| 336 | /* Write #1: fill in SLP_TYP data */ |
| 337 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 338 | status = acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK, |
| 339 | ACPI_REGISTER_PM1A_CONTROL, |
| 340 | PM1Acontrol); |
| 341 | if (ACPI_FAILURE(status)) { |
| 342 | return_ACPI_STATUS(status); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 343 | } |
| 344 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 345 | status = acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK, |
| 346 | ACPI_REGISTER_PM1B_CONTROL, |
| 347 | PM1Bcontrol); |
| 348 | if (ACPI_FAILURE(status)) { |
| 349 | return_ACPI_STATUS(status); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 350 | } |
| 351 | |
| 352 | /* Insert SLP_ENABLE bit */ |
| 353 | |
| 354 | PM1Acontrol |= sleep_enable_reg_info->access_bit_mask; |
| 355 | PM1Bcontrol |= sleep_enable_reg_info->access_bit_mask; |
| 356 | |
| 357 | /* Write #2: SLP_TYP + SLP_EN */ |
| 358 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 359 | ACPI_FLUSH_CPU_CACHE(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 360 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 361 | status = acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK, |
| 362 | ACPI_REGISTER_PM1A_CONTROL, |
| 363 | PM1Acontrol); |
| 364 | if (ACPI_FAILURE(status)) { |
| 365 | return_ACPI_STATUS(status); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 366 | } |
| 367 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 368 | status = acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK, |
| 369 | ACPI_REGISTER_PM1B_CONTROL, |
| 370 | PM1Bcontrol); |
| 371 | if (ACPI_FAILURE(status)) { |
| 372 | return_ACPI_STATUS(status); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 373 | } |
| 374 | |
| 375 | if (sleep_state > ACPI_STATE_S3) { |
| 376 | /* |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 377 | * We wanted to sleep > S3, but it didn't happen (by virtue of the |
| 378 | * fact that we are still executing!) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 379 | * |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 380 | * Wait ten seconds, then try again. This is to get S4/S5 to work on |
| 381 | * all machines. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 382 | * |
| 383 | * We wait so long to allow chipsets that poll this reg very slowly to |
| 384 | * still read the right value. Ideally, this block would go |
| 385 | * away entirely. |
| 386 | */ |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 387 | acpi_os_stall(10000000); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 388 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 389 | status = acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK, |
| 390 | ACPI_REGISTER_PM1_CONTROL, |
| 391 | sleep_enable_reg_info-> |
| 392 | access_bit_mask); |
| 393 | if (ACPI_FAILURE(status)) { |
| 394 | return_ACPI_STATUS(status); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 395 | } |
| 396 | } |
| 397 | |
| 398 | /* Wait until we enter sleep state */ |
| 399 | |
| 400 | do { |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 401 | status = acpi_get_register(ACPI_BITREG_WAKE_STATUS, &in_value, |
| 402 | ACPI_MTX_DO_NOT_LOCK); |
| 403 | if (ACPI_FAILURE(status)) { |
| 404 | return_ACPI_STATUS(status); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 405 | } |
| 406 | |
| 407 | /* Spin until we wake */ |
| 408 | |
| 409 | } while (!in_value); |
| 410 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 411 | return_ACPI_STATUS(AE_OK); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 412 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 413 | |
Bob Moore | 8313524 | 2006-10-03 00:00:00 -0400 | [diff] [blame] | 414 | ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 415 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 416 | /******************************************************************************* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 417 | * |
| 418 | * FUNCTION: acpi_enter_sleep_state_s4bios |
| 419 | * |
| 420 | * PARAMETERS: None |
| 421 | * |
| 422 | * RETURN: Status |
| 423 | * |
| 424 | * DESCRIPTION: Perform a S4 bios request. |
| 425 | * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED |
| 426 | * |
| 427 | ******************************************************************************/ |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 428 | acpi_status asmlinkage acpi_enter_sleep_state_s4bios(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 429 | { |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 430 | u32 in_value; |
| 431 | acpi_status status; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 432 | |
Bob Moore | b229cf9 | 2006-04-21 17:15:00 -0400 | [diff] [blame] | 433 | ACPI_FUNCTION_TRACE(acpi_enter_sleep_state_s4bios); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 434 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 435 | status = |
| 436 | acpi_set_register(ACPI_BITREG_WAKE_STATUS, 1, ACPI_MTX_DO_NOT_LOCK); |
| 437 | if (ACPI_FAILURE(status)) { |
| 438 | return_ACPI_STATUS(status); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 439 | } |
| 440 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 441 | status = acpi_hw_clear_acpi_status(ACPI_MTX_DO_NOT_LOCK); |
| 442 | if (ACPI_FAILURE(status)) { |
| 443 | return_ACPI_STATUS(status); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 444 | } |
| 445 | |
| 446 | /* |
| 447 | * 1) Disable/Clear all GPEs |
| 448 | * 2) Enable all wakeup GPEs |
| 449 | */ |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 450 | status = acpi_hw_disable_all_gpes(); |
| 451 | if (ACPI_FAILURE(status)) { |
| 452 | return_ACPI_STATUS(status); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 453 | } |
| 454 | acpi_gbl_system_awake_and_running = FALSE; |
| 455 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 456 | status = acpi_hw_enable_all_wakeup_gpes(); |
| 457 | if (ACPI_FAILURE(status)) { |
| 458 | return_ACPI_STATUS(status); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 459 | } |
| 460 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 461 | ACPI_FLUSH_CPU_CACHE(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 462 | |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 463 | status = acpi_os_write_port(acpi_gbl_FADT.smi_command, |
| 464 | (u32) acpi_gbl_FADT.S4bios_request, 8); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 465 | |
| 466 | do { |
| 467 | acpi_os_stall(1000); |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 468 | status = acpi_get_register(ACPI_BITREG_WAKE_STATUS, &in_value, |
| 469 | ACPI_MTX_DO_NOT_LOCK); |
| 470 | if (ACPI_FAILURE(status)) { |
| 471 | return_ACPI_STATUS(status); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 472 | } |
| 473 | } while (!in_value); |
| 474 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 475 | return_ACPI_STATUS(AE_OK); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 476 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 477 | |
Bob Moore | 8313524 | 2006-10-03 00:00:00 -0400 | [diff] [blame] | 478 | ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state_s4bios) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 479 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 480 | /******************************************************************************* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 481 | * |
| 482 | * FUNCTION: acpi_leave_sleep_state |
| 483 | * |
| 484 | * PARAMETERS: sleep_state - Which sleep state we just exited |
| 485 | * |
| 486 | * RETURN: Status |
| 487 | * |
| 488 | * DESCRIPTION: Perform OS-independent ACPI cleanup after a sleep |
| 489 | * Called with interrupts ENABLED. |
| 490 | * |
| 491 | ******************************************************************************/ |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 492 | acpi_status acpi_leave_sleep_state(u8 sleep_state) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 493 | { |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 494 | struct acpi_object_list arg_list; |
| 495 | union acpi_object arg; |
| 496 | acpi_status status; |
| 497 | struct acpi_bit_register_info *sleep_type_reg_info; |
| 498 | struct acpi_bit_register_info *sleep_enable_reg_info; |
| 499 | u32 PM1Acontrol; |
| 500 | u32 PM1Bcontrol; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 501 | |
Bob Moore | b229cf9 | 2006-04-21 17:15:00 -0400 | [diff] [blame] | 502 | ACPI_FUNCTION_TRACE(acpi_leave_sleep_state); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 503 | |
| 504 | /* |
| 505 | * Set SLP_TYPE and SLP_EN to state S0. |
| 506 | * This is unclear from the ACPI Spec, but it is required |
| 507 | * by some machines. |
| 508 | */ |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 509 | status = acpi_get_sleep_type_data(ACPI_STATE_S0, |
| 510 | &acpi_gbl_sleep_type_a, |
| 511 | &acpi_gbl_sleep_type_b); |
| 512 | if (ACPI_SUCCESS(status)) { |
| 513 | sleep_type_reg_info = |
| 514 | acpi_hw_get_bit_register_info(ACPI_BITREG_SLEEP_TYPE_A); |
| 515 | sleep_enable_reg_info = |
| 516 | acpi_hw_get_bit_register_info(ACPI_BITREG_SLEEP_ENABLE); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 517 | |
| 518 | /* Get current value of PM1A control */ |
| 519 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 520 | status = acpi_hw_register_read(ACPI_MTX_DO_NOT_LOCK, |
| 521 | ACPI_REGISTER_PM1_CONTROL, |
| 522 | &PM1Acontrol); |
| 523 | if (ACPI_SUCCESS(status)) { |
Bob Moore | 52fc0b0 | 2006-10-02 00:00:00 -0400 | [diff] [blame] | 524 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 525 | /* Clear SLP_EN and SLP_TYP fields */ |
| 526 | |
| 527 | PM1Acontrol &= ~(sleep_type_reg_info->access_bit_mask | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 528 | sleep_enable_reg_info-> |
| 529 | access_bit_mask); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 530 | PM1Bcontrol = PM1Acontrol; |
| 531 | |
| 532 | /* Insert SLP_TYP bits */ |
| 533 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 534 | PM1Acontrol |= |
| 535 | (acpi_gbl_sleep_type_a << sleep_type_reg_info-> |
| 536 | bit_position); |
| 537 | PM1Bcontrol |= |
| 538 | (acpi_gbl_sleep_type_b << sleep_type_reg_info-> |
| 539 | bit_position); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 540 | |
| 541 | /* Just ignore any errors */ |
| 542 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 543 | (void)acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK, |
| 544 | ACPI_REGISTER_PM1A_CONTROL, |
| 545 | PM1Acontrol); |
| 546 | (void)acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK, |
| 547 | ACPI_REGISTER_PM1B_CONTROL, |
| 548 | PM1Bcontrol); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 549 | } |
| 550 | } |
| 551 | |
| 552 | /* Ensure enter_sleep_state_prep -> enter_sleep_state ordering */ |
| 553 | |
| 554 | acpi_gbl_sleep_type_a = ACPI_SLEEP_TYPE_INVALID; |
| 555 | |
| 556 | /* Setup parameter object */ |
| 557 | |
| 558 | arg_list.count = 1; |
| 559 | arg_list.pointer = &arg; |
| 560 | arg.type = ACPI_TYPE_INTEGER; |
| 561 | |
| 562 | /* Ignore any errors from these methods */ |
| 563 | |
| 564 | arg.integer.value = ACPI_SST_WAKING; |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 565 | status = acpi_evaluate_object(NULL, METHOD_NAME__SST, &arg_list, NULL); |
| 566 | if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) { |
Bob Moore | b8e4d89 | 2006-01-27 16:43:00 -0500 | [diff] [blame] | 567 | ACPI_EXCEPTION((AE_INFO, status, "During Method _SST")); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 568 | } |
| 569 | |
| 570 | arg.integer.value = sleep_state; |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 571 | status = acpi_evaluate_object(NULL, METHOD_NAME__BFS, &arg_list, NULL); |
| 572 | if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) { |
Bob Moore | b8e4d89 | 2006-01-27 16:43:00 -0500 | [diff] [blame] | 573 | ACPI_EXCEPTION((AE_INFO, status, "During Method _BFS")); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 574 | } |
| 575 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 576 | status = acpi_evaluate_object(NULL, METHOD_NAME__WAK, &arg_list, NULL); |
| 577 | if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) { |
Bob Moore | b8e4d89 | 2006-01-27 16:43:00 -0500 | [diff] [blame] | 578 | ACPI_EXCEPTION((AE_INFO, status, "During Method _WAK")); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 579 | } |
| 580 | /* TBD: _WAK "sometimes" returns stuff - do we want to look at it? */ |
| 581 | |
| 582 | /* |
| 583 | * Restore the GPEs: |
| 584 | * 1) Disable/Clear all GPEs |
| 585 | * 2) Enable all runtime GPEs |
| 586 | */ |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 587 | status = acpi_hw_disable_all_gpes(); |
| 588 | if (ACPI_FAILURE(status)) { |
| 589 | return_ACPI_STATUS(status); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 590 | } |
| 591 | acpi_gbl_system_awake_and_running = TRUE; |
| 592 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 593 | status = acpi_hw_enable_all_runtime_gpes(); |
| 594 | if (ACPI_FAILURE(status)) { |
| 595 | return_ACPI_STATUS(status); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 596 | } |
| 597 | |
| 598 | /* Enable power button */ |
| 599 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 600 | (void) |
| 601 | acpi_set_register(acpi_gbl_fixed_event_info |
| 602 | [ACPI_EVENT_POWER_BUTTON].enable_register_id, 1, |
| 603 | ACPI_MTX_DO_NOT_LOCK); |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 604 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 605 | (void) |
| 606 | acpi_set_register(acpi_gbl_fixed_event_info |
| 607 | [ACPI_EVENT_POWER_BUTTON].status_register_id, 1, |
| 608 | ACPI_MTX_DO_NOT_LOCK); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 609 | |
| 610 | arg.integer.value = ACPI_SST_WORKING; |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 611 | status = acpi_evaluate_object(NULL, METHOD_NAME__SST, &arg_list, NULL); |
| 612 | if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) { |
Bob Moore | b8e4d89 | 2006-01-27 16:43:00 -0500 | [diff] [blame] | 613 | ACPI_EXCEPTION((AE_INFO, status, "During Method _SST")); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 614 | } |
| 615 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 616 | return_ACPI_STATUS(status); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 617 | } |
Bob Moore | 8313524 | 2006-10-03 00:00:00 -0400 | [diff] [blame] | 618 | |
| 619 | ACPI_EXPORT_SYMBOL(acpi_leave_sleep_state) |