Erik Schmauss | 9585763 | 2018-03-14 16:13:07 -0700 | [diff] [blame] | 1 | // SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 |
Bob Moore | 2feec47 | 2012-02-14 15:00:53 +0800 | [diff] [blame] | 2 | /****************************************************************************** |
| 3 | * |
| 4 | * Name: hwxfsleep.c - ACPI Hardware Sleep/Wake External Interfaces |
| 5 | * |
Bob Moore | 4441e55 | 2021-01-15 10:48:25 -0800 | [diff] [blame] | 6 | * Copyright (C) 2000 - 2021, Intel Corp. |
Bob Moore | 2feec47 | 2012-02-14 15:00:53 +0800 | [diff] [blame] | 7 | * |
Erik Schmauss | 9585763 | 2018-03-14 16:13:07 -0700 | [diff] [blame] | 8 | *****************************************************************************/ |
Bob Moore | 2feec47 | 2012-02-14 15:00:53 +0800 | [diff] [blame] | 9 | |
Lv Zheng | 839e928 | 2013-10-29 09:29:51 +0800 | [diff] [blame] | 10 | #define EXPORT_ACPI_INTERFACES |
| 11 | |
Bob Moore | 2feec47 | 2012-02-14 15:00:53 +0800 | [diff] [blame] | 12 | #include <acpi/acpi.h> |
| 13 | #include "accommon.h" |
Bob Moore | 2feec47 | 2012-02-14 15:00:53 +0800 | [diff] [blame] | 14 | |
| 15 | #define _COMPONENT ACPI_HARDWARE |
| 16 | ACPI_MODULE_NAME("hwxfsleep") |
| 17 | |
Bob Moore | 72a8887 | 2012-02-14 18:57:13 +0800 | [diff] [blame] | 18 | /* Local prototypes */ |
Lv Zheng | f06147f | 2015-07-01 14:43:18 +0800 | [diff] [blame] | 19 | #if (!ACPI_REDUCED_HARDWARE) |
| 20 | static acpi_status |
Rafael J. Wysocki | e3e9b57 | 2016-01-04 22:05:20 +0100 | [diff] [blame] | 21 | acpi_hw_set_firmware_waking_vector(struct acpi_table_facs *facs, |
| 22 | acpi_physical_address physical_address, |
| 23 | acpi_physical_address physical_address64); |
Lv Zheng | f06147f | 2015-07-01 14:43:18 +0800 | [diff] [blame] | 24 | #endif |
| 25 | |
Bob Moore | 72a8887 | 2012-02-14 18:57:13 +0800 | [diff] [blame] | 26 | /* |
| 27 | * These functions are removed for the ACPI_REDUCED_HARDWARE case: |
| 28 | * acpi_set_firmware_waking_vector |
Bob Moore | 72a8887 | 2012-02-14 18:57:13 +0800 | [diff] [blame] | 29 | * acpi_enter_sleep_state_s4bios |
| 30 | */ |
| 31 | |
Bob Moore | 33620c5 | 2012-02-14 18:14:27 +0800 | [diff] [blame] | 32 | #if (!ACPI_REDUCED_HARDWARE) |
Bob Moore | 2feec47 | 2012-02-14 15:00:53 +0800 | [diff] [blame] | 33 | /******************************************************************************* |
| 34 | * |
Rafael J. Wysocki | e3e9b57 | 2016-01-04 22:05:20 +0100 | [diff] [blame] | 35 | * FUNCTION: acpi_hw_set_firmware_waking_vector |
Lv Zheng | f06147f | 2015-07-01 14:43:18 +0800 | [diff] [blame] | 36 | * |
| 37 | * PARAMETERS: facs - Pointer to FACS table |
| 38 | * physical_address - 32-bit physical address of ACPI real mode |
Rafael J. Wysocki | e3e9b57 | 2016-01-04 22:05:20 +0100 | [diff] [blame] | 39 | * entry point |
Lv Zheng | f06147f | 2015-07-01 14:43:18 +0800 | [diff] [blame] | 40 | * physical_address64 - 64-bit physical address of ACPI protected |
Rafael J. Wysocki | e3e9b57 | 2016-01-04 22:05:20 +0100 | [diff] [blame] | 41 | * mode entry point |
Lv Zheng | f06147f | 2015-07-01 14:43:18 +0800 | [diff] [blame] | 42 | * |
| 43 | * RETURN: Status |
| 44 | * |
| 45 | * DESCRIPTION: Sets the firmware_waking_vector fields of the FACS |
| 46 | * |
| 47 | ******************************************************************************/ |
| 48 | |
| 49 | static acpi_status |
Rafael J. Wysocki | e3e9b57 | 2016-01-04 22:05:20 +0100 | [diff] [blame] | 50 | acpi_hw_set_firmware_waking_vector(struct acpi_table_facs *facs, |
| 51 | acpi_physical_address physical_address, |
| 52 | acpi_physical_address physical_address64) |
Lv Zheng | f06147f | 2015-07-01 14:43:18 +0800 | [diff] [blame] | 53 | { |
Rafael J. Wysocki | e3e9b57 | 2016-01-04 22:05:20 +0100 | [diff] [blame] | 54 | ACPI_FUNCTION_TRACE(acpi_hw_set_firmware_waking_vector); |
Lv Zheng | f06147f | 2015-07-01 14:43:18 +0800 | [diff] [blame] | 55 | |
| 56 | |
| 57 | /* |
| 58 | * According to the ACPI specification 2.0c and later, the 64-bit |
| 59 | * waking vector should be cleared and the 32-bit waking vector should |
| 60 | * be used, unless we want the wake-up code to be called by the BIOS in |
| 61 | * Protected Mode. Some systems (for example HP dv5-1004nr) are known |
| 62 | * to fail to resume if the 64-bit vector is used. |
| 63 | */ |
| 64 | |
| 65 | /* Set the 32-bit vector */ |
| 66 | |
| 67 | facs->firmware_waking_vector = (u32)physical_address; |
| 68 | |
| 69 | if (facs->length > 32) { |
| 70 | if (facs->version >= 1) { |
| 71 | |
| 72 | /* Set the 64-bit vector */ |
| 73 | |
| 74 | facs->xfirmware_waking_vector = physical_address64; |
| 75 | } else { |
| 76 | /* Clear the 64-bit vector if it exists */ |
| 77 | |
| 78 | facs->xfirmware_waking_vector = 0; |
| 79 | } |
| 80 | } |
| 81 | |
| 82 | return_ACPI_STATUS(AE_OK); |
| 83 | } |
| 84 | |
| 85 | /******************************************************************************* |
| 86 | * |
Rafael J. Wysocki | e3e9b57 | 2016-01-04 22:05:20 +0100 | [diff] [blame] | 87 | * FUNCTION: acpi_set_firmware_waking_vector |
Bob Moore | 2feec47 | 2012-02-14 15:00:53 +0800 | [diff] [blame] | 88 | * |
| 89 | * PARAMETERS: physical_address - 32-bit physical address of ACPI real mode |
Rafael J. Wysocki | e3e9b57 | 2016-01-04 22:05:20 +0100 | [diff] [blame] | 90 | * entry point |
Lv Zheng | aca2a5d | 2015-07-01 14:43:04 +0800 | [diff] [blame] | 91 | * physical_address64 - 64-bit physical address of ACPI protected |
Rafael J. Wysocki | e3e9b57 | 2016-01-04 22:05:20 +0100 | [diff] [blame] | 92 | * mode entry point |
Bob Moore | 2feec47 | 2012-02-14 15:00:53 +0800 | [diff] [blame] | 93 | * |
| 94 | * RETURN: Status |
| 95 | * |
Lv Zheng | aca2a5d | 2015-07-01 14:43:04 +0800 | [diff] [blame] | 96 | * DESCRIPTION: Sets the firmware_waking_vector fields of the FACS |
Bob Moore | 2feec47 | 2012-02-14 15:00:53 +0800 | [diff] [blame] | 97 | * |
| 98 | ******************************************************************************/ |
Bob Moore | 72a8887 | 2012-02-14 18:57:13 +0800 | [diff] [blame] | 99 | |
Lv Zheng | aca2a5d | 2015-07-01 14:43:04 +0800 | [diff] [blame] | 100 | acpi_status |
Rafael J. Wysocki | e3e9b57 | 2016-01-04 22:05:20 +0100 | [diff] [blame] | 101 | acpi_set_firmware_waking_vector(acpi_physical_address physical_address, |
| 102 | acpi_physical_address physical_address64) |
Bob Moore | 2feec47 | 2012-02-14 15:00:53 +0800 | [diff] [blame] | 103 | { |
Lv Zheng | f06147f | 2015-07-01 14:43:18 +0800 | [diff] [blame] | 104 | |
Rafael J. Wysocki | e3e9b57 | 2016-01-04 22:05:20 +0100 | [diff] [blame] | 105 | ACPI_FUNCTION_TRACE(acpi_set_firmware_waking_vector); |
Bob Moore | 2feec47 | 2012-02-14 15:00:53 +0800 | [diff] [blame] | 106 | |
Lv Zheng | 7484619 | 2015-08-25 10:29:08 +0800 | [diff] [blame] | 107 | if (acpi_gbl_FACS) { |
Rafael J. Wysocki | e3e9b57 | 2016-01-04 22:05:20 +0100 | [diff] [blame] | 108 | (void)acpi_hw_set_firmware_waking_vector(acpi_gbl_FACS, |
| 109 | physical_address, |
| 110 | physical_address64); |
Bob Moore | 2feec47 | 2012-02-14 15:00:53 +0800 | [diff] [blame] | 111 | } |
| 112 | |
| 113 | return_ACPI_STATUS(AE_OK); |
| 114 | } |
| 115 | |
| 116 | ACPI_EXPORT_SYMBOL(acpi_set_firmware_waking_vector) |
| 117 | |
Bob Moore | 2feec47 | 2012-02-14 15:00:53 +0800 | [diff] [blame] | 118 | /******************************************************************************* |
| 119 | * |
| 120 | * FUNCTION: acpi_enter_sleep_state_s4bios |
| 121 | * |
| 122 | * PARAMETERS: None |
| 123 | * |
| 124 | * RETURN: Status |
| 125 | * |
| 126 | * DESCRIPTION: Perform a S4 bios request. |
| 127 | * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED |
| 128 | * |
| 129 | ******************************************************************************/ |
Lv Zheng | 40bce10 | 2013-10-31 09:31:18 +0800 | [diff] [blame] | 130 | acpi_status acpi_enter_sleep_state_s4bios(void) |
Bob Moore | 2feec47 | 2012-02-14 15:00:53 +0800 | [diff] [blame] | 131 | { |
| 132 | u32 in_value; |
| 133 | acpi_status status; |
| 134 | |
| 135 | ACPI_FUNCTION_TRACE(acpi_enter_sleep_state_s4bios); |
| 136 | |
| 137 | /* Clear the wake status bit (PM1) */ |
| 138 | |
| 139 | status = |
| 140 | acpi_write_bit_register(ACPI_BITREG_WAKE_STATUS, ACPI_CLEAR_STATUS); |
| 141 | if (ACPI_FAILURE(status)) { |
| 142 | return_ACPI_STATUS(status); |
| 143 | } |
| 144 | |
| 145 | status = acpi_hw_clear_acpi_status(); |
| 146 | if (ACPI_FAILURE(status)) { |
| 147 | return_ACPI_STATUS(status); |
| 148 | } |
| 149 | |
| 150 | /* |
Erik Schmauss | 18996f2 | 2018-03-14 16:12:57 -0700 | [diff] [blame] | 151 | * 1) Disable all GPEs |
Bob Moore | 2feec47 | 2012-02-14 15:00:53 +0800 | [diff] [blame] | 152 | * 2) Enable all wakeup GPEs |
| 153 | */ |
| 154 | status = acpi_hw_disable_all_gpes(); |
| 155 | if (ACPI_FAILURE(status)) { |
| 156 | return_ACPI_STATUS(status); |
| 157 | } |
| 158 | acpi_gbl_system_awake_and_running = FALSE; |
| 159 | |
| 160 | status = acpi_hw_enable_all_wakeup_gpes(); |
| 161 | if (ACPI_FAILURE(status)) { |
| 162 | return_ACPI_STATUS(status); |
| 163 | } |
| 164 | |
| 165 | ACPI_FLUSH_CPU_CACHE(); |
| 166 | |
| 167 | status = acpi_hw_write_port(acpi_gbl_FADT.smi_command, |
Bob Moore | ba494be | 2012-07-12 09:40:10 +0800 | [diff] [blame] | 168 | (u32)acpi_gbl_FADT.s4_bios_request, 8); |
Bob Moore | aaf7566 | 2019-10-25 14:36:51 -0700 | [diff] [blame] | 169 | if (ACPI_FAILURE(status)) { |
| 170 | return_ACPI_STATUS(status); |
| 171 | } |
Bob Moore | 2feec47 | 2012-02-14 15:00:53 +0800 | [diff] [blame] | 172 | |
| 173 | do { |
Bob Moore | c41679a | 2012-12-31 00:05:46 +0000 | [diff] [blame] | 174 | acpi_os_stall(ACPI_USEC_PER_MSEC); |
Bob Moore | 2feec47 | 2012-02-14 15:00:53 +0800 | [diff] [blame] | 175 | status = |
| 176 | acpi_read_bit_register(ACPI_BITREG_WAKE_STATUS, &in_value); |
| 177 | if (ACPI_FAILURE(status)) { |
| 178 | return_ACPI_STATUS(status); |
| 179 | } |
Bob Moore | 1fad873 | 2015-12-29 13:54:36 +0800 | [diff] [blame] | 180 | |
Bob Moore | 2feec47 | 2012-02-14 15:00:53 +0800 | [diff] [blame] | 181 | } while (!in_value); |
| 182 | |
| 183 | return_ACPI_STATUS(AE_OK); |
| 184 | } |
| 185 | |
| 186 | ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state_s4bios) |
Bob Moore | 33620c5 | 2012-02-14 18:14:27 +0800 | [diff] [blame] | 187 | #endif /* !ACPI_REDUCED_HARDWARE */ |
Bob Moore | 72a8887 | 2012-02-14 18:57:13 +0800 | [diff] [blame] | 188 | |
| 189 | /******************************************************************************* |
| 190 | * |
Bob Moore | 2feec47 | 2012-02-14 15:00:53 +0800 | [diff] [blame] | 191 | * FUNCTION: acpi_enter_sleep_state_prep |
| 192 | * |
| 193 | * PARAMETERS: sleep_state - Which sleep state to enter |
| 194 | * |
| 195 | * RETURN: Status |
| 196 | * |
Bob Moore | 72a8887 | 2012-02-14 18:57:13 +0800 | [diff] [blame] | 197 | * DESCRIPTION: Prepare to enter a system sleep state. |
Bob Moore | 2feec47 | 2012-02-14 15:00:53 +0800 | [diff] [blame] | 198 | * This function must execute with interrupts enabled. |
| 199 | * We break sleeping into 2 stages so that OSPM can handle |
| 200 | * various OS-specific tasks between the two steps. |
| 201 | * |
| 202 | ******************************************************************************/ |
Bob Moore | 72a8887 | 2012-02-14 18:57:13 +0800 | [diff] [blame] | 203 | |
Bob Moore | 2feec47 | 2012-02-14 15:00:53 +0800 | [diff] [blame] | 204 | acpi_status acpi_enter_sleep_state_prep(u8 sleep_state) |
| 205 | { |
| 206 | acpi_status status; |
| 207 | struct acpi_object_list arg_list; |
| 208 | union acpi_object arg; |
| 209 | u32 sst_value; |
| 210 | |
| 211 | ACPI_FUNCTION_TRACE(acpi_enter_sleep_state_prep); |
| 212 | |
Bob Moore | 2feec47 | 2012-02-14 15:00:53 +0800 | [diff] [blame] | 213 | status = acpi_get_sleep_type_data(sleep_state, |
| 214 | &acpi_gbl_sleep_type_a, |
| 215 | &acpi_gbl_sleep_type_b); |
| 216 | if (ACPI_FAILURE(status)) { |
| 217 | return_ACPI_STATUS(status); |
| 218 | } |
| 219 | |
| 220 | /* Execute the _PTS method (Prepare To Sleep) */ |
| 221 | |
| 222 | arg_list.count = 1; |
| 223 | arg_list.pointer = &arg; |
| 224 | arg.type = ACPI_TYPE_INTEGER; |
| 225 | arg.integer.value = sleep_state; |
| 226 | |
Bob Moore | 4efeeec | 2012-03-21 09:42:45 +0800 | [diff] [blame] | 227 | status = |
| 228 | acpi_evaluate_object(NULL, METHOD_PATHNAME__PTS, &arg_list, NULL); |
Bob Moore | 2feec47 | 2012-02-14 15:00:53 +0800 | [diff] [blame] | 229 | if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) { |
| 230 | return_ACPI_STATUS(status); |
| 231 | } |
| 232 | |
| 233 | /* Setup the argument to the _SST method (System STatus) */ |
| 234 | |
| 235 | switch (sleep_state) { |
| 236 | case ACPI_STATE_S0: |
Chao Guan | 1d1ea1b7 | 2013-06-08 00:58:14 +0000 | [diff] [blame] | 237 | |
Bob Moore | 2feec47 | 2012-02-14 15:00:53 +0800 | [diff] [blame] | 238 | sst_value = ACPI_SST_WORKING; |
| 239 | break; |
| 240 | |
| 241 | case ACPI_STATE_S1: |
| 242 | case ACPI_STATE_S2: |
| 243 | case ACPI_STATE_S3: |
Chao Guan | 1d1ea1b7 | 2013-06-08 00:58:14 +0000 | [diff] [blame] | 244 | |
Bob Moore | 2feec47 | 2012-02-14 15:00:53 +0800 | [diff] [blame] | 245 | sst_value = ACPI_SST_SLEEPING; |
| 246 | break; |
| 247 | |
| 248 | case ACPI_STATE_S4: |
Chao Guan | 1d1ea1b7 | 2013-06-08 00:58:14 +0000 | [diff] [blame] | 249 | |
Bob Moore | 2feec47 | 2012-02-14 15:00:53 +0800 | [diff] [blame] | 250 | sst_value = ACPI_SST_SLEEP_CONTEXT; |
| 251 | break; |
| 252 | |
| 253 | default: |
Chao Guan | 1d1ea1b7 | 2013-06-08 00:58:14 +0000 | [diff] [blame] | 254 | |
Bob Moore | 2feec47 | 2012-02-14 15:00:53 +0800 | [diff] [blame] | 255 | sst_value = ACPI_SST_INDICATOR_OFF; /* Default is off */ |
| 256 | break; |
| 257 | } |
| 258 | |
| 259 | /* |
| 260 | * Set the system indicators to show the desired sleep state. |
| 261 | * _SST is an optional method (return no error if not found) |
| 262 | */ |
Bob Moore | 4efeeec | 2012-03-21 09:42:45 +0800 | [diff] [blame] | 263 | acpi_hw_execute_sleep_method(METHOD_PATHNAME__SST, sst_value); |
Bob Moore | 2feec47 | 2012-02-14 15:00:53 +0800 | [diff] [blame] | 264 | return_ACPI_STATUS(AE_OK); |
| 265 | } |
| 266 | |
| 267 | ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state_prep) |
| 268 | |
| 269 | /******************************************************************************* |
| 270 | * |
| 271 | * FUNCTION: acpi_enter_sleep_state |
| 272 | * |
| 273 | * PARAMETERS: sleep_state - Which sleep state to enter |
| 274 | * |
| 275 | * RETURN: Status |
| 276 | * |
Lv Zheng | 75c8044 | 2012-12-19 05:36:49 +0000 | [diff] [blame] | 277 | * DESCRIPTION: Enter a system sleep state |
Bob Moore | 2feec47 | 2012-02-14 15:00:53 +0800 | [diff] [blame] | 278 | * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED |
| 279 | * |
| 280 | ******************************************************************************/ |
Lv Zheng | 40bce10 | 2013-10-31 09:31:18 +0800 | [diff] [blame] | 281 | acpi_status acpi_enter_sleep_state(u8 sleep_state) |
Bob Moore | 2feec47 | 2012-02-14 15:00:53 +0800 | [diff] [blame] | 282 | { |
| 283 | acpi_status status; |
| 284 | |
| 285 | ACPI_FUNCTION_TRACE(acpi_enter_sleep_state); |
| 286 | |
| 287 | if ((acpi_gbl_sleep_type_a > ACPI_SLEEP_TYPE_MAX) || |
| 288 | (acpi_gbl_sleep_type_b > ACPI_SLEEP_TYPE_MAX)) { |
| 289 | ACPI_ERROR((AE_INFO, "Sleep values out of range: A=0x%X B=0x%X", |
| 290 | acpi_gbl_sleep_type_a, acpi_gbl_sleep_type_b)); |
| 291 | return_ACPI_STATUS(AE_AML_OPERAND_VALUE); |
| 292 | } |
| 293 | |
Christoph Hellwig | f2fee24 | 2019-02-04 16:32:10 +0100 | [diff] [blame] | 294 | #if !ACPI_REDUCED_HARDWARE |
| 295 | if (!acpi_gbl_reduced_hardware) |
| 296 | status = acpi_hw_legacy_sleep(sleep_state); |
| 297 | else |
| 298 | #endif |
| 299 | status = acpi_hw_extended_sleep(sleep_state); |
Bob Moore | 2feec47 | 2012-02-14 15:00:53 +0800 | [diff] [blame] | 300 | return_ACPI_STATUS(status); |
| 301 | } |
| 302 | |
| 303 | ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state) |
| 304 | |
| 305 | /******************************************************************************* |
| 306 | * |
| 307 | * FUNCTION: acpi_leave_sleep_state_prep |
| 308 | * |
| 309 | * PARAMETERS: sleep_state - Which sleep state we are exiting |
| 310 | * |
| 311 | * RETURN: Status |
| 312 | * |
| 313 | * DESCRIPTION: Perform the first state of OS-independent ACPI cleanup after a |
Lv Zheng | 75c8044 | 2012-12-19 05:36:49 +0000 | [diff] [blame] | 314 | * sleep. Called with interrupts DISABLED. |
| 315 | * We break wake/resume into 2 stages so that OSPM can handle |
| 316 | * various OS-specific tasks between the two steps. |
Bob Moore | 2feec47 | 2012-02-14 15:00:53 +0800 | [diff] [blame] | 317 | * |
| 318 | ******************************************************************************/ |
Len Brown | 3f6f49c | 2012-07-26 20:08:54 -0400 | [diff] [blame] | 319 | acpi_status acpi_leave_sleep_state_prep(u8 sleep_state) |
Bob Moore | 2feec47 | 2012-02-14 15:00:53 +0800 | [diff] [blame] | 320 | { |
| 321 | acpi_status status; |
| 322 | |
Bob Moore | 72a8887 | 2012-02-14 18:57:13 +0800 | [diff] [blame] | 323 | ACPI_FUNCTION_TRACE(acpi_leave_sleep_state_prep); |
Bob Moore | 2feec47 | 2012-02-14 15:00:53 +0800 | [diff] [blame] | 324 | |
Christoph Hellwig | f2fee24 | 2019-02-04 16:32:10 +0100 | [diff] [blame] | 325 | #if !ACPI_REDUCED_HARDWARE |
| 326 | if (!acpi_gbl_reduced_hardware) |
| 327 | status = acpi_hw_legacy_wake_prep(sleep_state); |
| 328 | else |
| 329 | #endif |
| 330 | status = acpi_hw_extended_wake_prep(sleep_state); |
Bob Moore | 2feec47 | 2012-02-14 15:00:53 +0800 | [diff] [blame] | 331 | return_ACPI_STATUS(status); |
| 332 | } |
| 333 | |
| 334 | ACPI_EXPORT_SYMBOL(acpi_leave_sleep_state_prep) |
| 335 | |
| 336 | /******************************************************************************* |
| 337 | * |
| 338 | * FUNCTION: acpi_leave_sleep_state |
| 339 | * |
Bob Moore | 72a8887 | 2012-02-14 18:57:13 +0800 | [diff] [blame] | 340 | * PARAMETERS: sleep_state - Which sleep state we are exiting |
Bob Moore | 2feec47 | 2012-02-14 15:00:53 +0800 | [diff] [blame] | 341 | * |
| 342 | * RETURN: Status |
| 343 | * |
| 344 | * DESCRIPTION: Perform OS-independent ACPI cleanup after a sleep |
| 345 | * Called with interrupts ENABLED. |
| 346 | * |
| 347 | ******************************************************************************/ |
| 348 | acpi_status acpi_leave_sleep_state(u8 sleep_state) |
| 349 | { |
| 350 | acpi_status status; |
| 351 | |
| 352 | ACPI_FUNCTION_TRACE(acpi_leave_sleep_state); |
| 353 | |
Christoph Hellwig | f2fee24 | 2019-02-04 16:32:10 +0100 | [diff] [blame] | 354 | #if !ACPI_REDUCED_HARDWARE |
| 355 | if (!acpi_gbl_reduced_hardware) |
| 356 | status = acpi_hw_legacy_wake(sleep_state); |
| 357 | else |
| 358 | #endif |
| 359 | status = acpi_hw_extended_wake(sleep_state); |
Bob Moore | 2feec47 | 2012-02-14 15:00:53 +0800 | [diff] [blame] | 360 | return_ACPI_STATUS(status); |
| 361 | } |
| 362 | |
| 363 | ACPI_EXPORT_SYMBOL(acpi_leave_sleep_state) |