hwsleep.c 17 KB

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