hwsleep.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620
  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. /*
  201. * 1) Disable/Clear all GPEs
  202. */
  203. status = acpi_hw_disable_all_gpes();
  204. if (ACPI_FAILURE(status)) {
  205. return_ACPI_STATUS(status);
  206. }
  207. return_ACPI_STATUS(AE_OK);
  208. }
  209. ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state_prep)
  210. /*******************************************************************************
  211. *
  212. * FUNCTION: acpi_enter_sleep_state
  213. *
  214. * PARAMETERS: sleep_state - Which sleep state to enter
  215. *
  216. * RETURN: Status
  217. *
  218. * DESCRIPTION: Enter a system sleep state (see ACPI 2.0 spec p 231)
  219. * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED
  220. *
  221. ******************************************************************************/
  222. acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state)
  223. {
  224. u32 PM1Acontrol;
  225. u32 PM1Bcontrol;
  226. struct acpi_bit_register_info *sleep_type_reg_info;
  227. struct acpi_bit_register_info *sleep_enable_reg_info;
  228. u32 in_value;
  229. acpi_status status;
  230. ACPI_FUNCTION_TRACE(acpi_enter_sleep_state);
  231. if ((acpi_gbl_sleep_type_a > ACPI_SLEEP_TYPE_MAX) ||
  232. (acpi_gbl_sleep_type_b > ACPI_SLEEP_TYPE_MAX)) {
  233. ACPI_ERROR((AE_INFO, "Sleep values out of range: A=%X B=%X",
  234. acpi_gbl_sleep_type_a, acpi_gbl_sleep_type_b));
  235. return_ACPI_STATUS(AE_AML_OPERAND_VALUE);
  236. }
  237. sleep_type_reg_info =
  238. acpi_hw_get_bit_register_info(ACPI_BITREG_SLEEP_TYPE_A);
  239. sleep_enable_reg_info =
  240. acpi_hw_get_bit_register_info(ACPI_BITREG_SLEEP_ENABLE);
  241. /* Clear wake status */
  242. status = acpi_set_register(ACPI_BITREG_WAKE_STATUS, 1);
  243. if (ACPI_FAILURE(status)) {
  244. return_ACPI_STATUS(status);
  245. }
  246. /* Clear all fixed and general purpose status bits */
  247. status = acpi_hw_clear_acpi_status();
  248. if (ACPI_FAILURE(status)) {
  249. return_ACPI_STATUS(status);
  250. }
  251. /*
  252. * 2) Enable all wakeup GPEs
  253. */
  254. status = acpi_hw_disable_all_gpes();
  255. if (ACPI_FAILURE(status)) {
  256. return_ACPI_STATUS(status);
  257. }
  258. acpi_gbl_system_awake_and_running = FALSE;
  259. status = acpi_hw_enable_all_wakeup_gpes();
  260. if (ACPI_FAILURE(status)) {
  261. return_ACPI_STATUS(status);
  262. }
  263. /* Get current value of PM1A control */
  264. status = acpi_hw_register_read(ACPI_MTX_DO_NOT_LOCK,
  265. ACPI_REGISTER_PM1_CONTROL, &PM1Acontrol);
  266. if (ACPI_FAILURE(status)) {
  267. return_ACPI_STATUS(status);
  268. }
  269. ACPI_DEBUG_PRINT((ACPI_DB_INIT,
  270. "Entering sleep state [S%d]\n", sleep_state));
  271. /* Clear SLP_EN and SLP_TYP fields */
  272. PM1Acontrol &= ~(sleep_type_reg_info->access_bit_mask |
  273. sleep_enable_reg_info->access_bit_mask);
  274. PM1Bcontrol = PM1Acontrol;
  275. /* Insert SLP_TYP bits */
  276. PM1Acontrol |=
  277. (acpi_gbl_sleep_type_a << sleep_type_reg_info->bit_position);
  278. PM1Bcontrol |=
  279. (acpi_gbl_sleep_type_b << sleep_type_reg_info->bit_position);
  280. /*
  281. * We split the writes of SLP_TYP and SLP_EN to workaround
  282. * poorly implemented hardware.
  283. */
  284. /* Write #1: fill in SLP_TYP data */
  285. status = acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK,
  286. ACPI_REGISTER_PM1A_CONTROL,
  287. PM1Acontrol);
  288. if (ACPI_FAILURE(status)) {
  289. return_ACPI_STATUS(status);
  290. }
  291. status = acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK,
  292. ACPI_REGISTER_PM1B_CONTROL,
  293. PM1Bcontrol);
  294. if (ACPI_FAILURE(status)) {
  295. return_ACPI_STATUS(status);
  296. }
  297. /* Insert SLP_ENABLE bit */
  298. PM1Acontrol |= sleep_enable_reg_info->access_bit_mask;
  299. PM1Bcontrol |= sleep_enable_reg_info->access_bit_mask;
  300. /* Write #2: SLP_TYP + SLP_EN */
  301. ACPI_FLUSH_CPU_CACHE();
  302. status = acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK,
  303. ACPI_REGISTER_PM1A_CONTROL,
  304. PM1Acontrol);
  305. if (ACPI_FAILURE(status)) {
  306. return_ACPI_STATUS(status);
  307. }
  308. status = acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK,
  309. ACPI_REGISTER_PM1B_CONTROL,
  310. PM1Bcontrol);
  311. if (ACPI_FAILURE(status)) {
  312. return_ACPI_STATUS(status);
  313. }
  314. if (sleep_state > ACPI_STATE_S3) {
  315. /*
  316. * We wanted to sleep > S3, but it didn't happen (by virtue of the
  317. * fact that we are still executing!)
  318. *
  319. * Wait ten seconds, then try again. This is to get S4/S5 to work on
  320. * all machines.
  321. *
  322. * We wait so long to allow chipsets that poll this reg very slowly to
  323. * still read the right value. Ideally, this block would go
  324. * away entirely.
  325. */
  326. acpi_os_stall(10000000);
  327. status = acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK,
  328. ACPI_REGISTER_PM1_CONTROL,
  329. sleep_enable_reg_info->
  330. access_bit_mask);
  331. if (ACPI_FAILURE(status)) {
  332. return_ACPI_STATUS(status);
  333. }
  334. }
  335. /* Wait until we enter sleep state */
  336. do {
  337. status = acpi_get_register(ACPI_BITREG_WAKE_STATUS, &in_value);
  338. if (ACPI_FAILURE(status)) {
  339. return_ACPI_STATUS(status);
  340. }
  341. /* Spin until we wake */
  342. } while (!in_value);
  343. return_ACPI_STATUS(AE_OK);
  344. }
  345. ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state)
  346. /*******************************************************************************
  347. *
  348. * FUNCTION: acpi_enter_sleep_state_s4bios
  349. *
  350. * PARAMETERS: None
  351. *
  352. * RETURN: Status
  353. *
  354. * DESCRIPTION: Perform a S4 bios request.
  355. * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED
  356. *
  357. ******************************************************************************/
  358. acpi_status asmlinkage acpi_enter_sleep_state_s4bios(void)
  359. {
  360. u32 in_value;
  361. acpi_status status;
  362. ACPI_FUNCTION_TRACE(acpi_enter_sleep_state_s4bios);
  363. status = acpi_set_register(ACPI_BITREG_WAKE_STATUS, 1);
  364. if (ACPI_FAILURE(status)) {
  365. return_ACPI_STATUS(status);
  366. }
  367. status = acpi_hw_clear_acpi_status();
  368. if (ACPI_FAILURE(status)) {
  369. return_ACPI_STATUS(status);
  370. }
  371. /*
  372. * 1) Disable/Clear all GPEs
  373. * 2) Enable all wakeup GPEs
  374. */
  375. status = acpi_hw_disable_all_gpes();
  376. if (ACPI_FAILURE(status)) {
  377. return_ACPI_STATUS(status);
  378. }
  379. acpi_gbl_system_awake_and_running = FALSE;
  380. status = acpi_hw_enable_all_wakeup_gpes();
  381. if (ACPI_FAILURE(status)) {
  382. return_ACPI_STATUS(status);
  383. }
  384. ACPI_FLUSH_CPU_CACHE();
  385. status = acpi_os_write_port(acpi_gbl_FADT.smi_command,
  386. (u32) acpi_gbl_FADT.S4bios_request, 8);
  387. do {
  388. acpi_os_stall(1000);
  389. status = acpi_get_register(ACPI_BITREG_WAKE_STATUS, &in_value);
  390. if (ACPI_FAILURE(status)) {
  391. return_ACPI_STATUS(status);
  392. }
  393. } while (!in_value);
  394. return_ACPI_STATUS(AE_OK);
  395. }
  396. ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state_s4bios)
  397. /*******************************************************************************
  398. *
  399. * FUNCTION: acpi_leave_sleep_state
  400. *
  401. * PARAMETERS: sleep_state - Which sleep state we just exited
  402. *
  403. * RETURN: Status
  404. *
  405. * DESCRIPTION: Perform OS-independent ACPI cleanup after a sleep
  406. * Called with interrupts ENABLED.
  407. *
  408. ******************************************************************************/
  409. acpi_status acpi_leave_sleep_state(u8 sleep_state)
  410. {
  411. struct acpi_object_list arg_list;
  412. union acpi_object arg;
  413. acpi_status status;
  414. struct acpi_bit_register_info *sleep_type_reg_info;
  415. struct acpi_bit_register_info *sleep_enable_reg_info;
  416. u32 PM1Acontrol;
  417. u32 PM1Bcontrol;
  418. ACPI_FUNCTION_TRACE(acpi_leave_sleep_state);
  419. /*
  420. * Set SLP_TYPE and SLP_EN to state S0.
  421. * This is unclear from the ACPI Spec, but it is required
  422. * by some machines.
  423. */
  424. status = acpi_get_sleep_type_data(ACPI_STATE_S0,
  425. &acpi_gbl_sleep_type_a,
  426. &acpi_gbl_sleep_type_b);
  427. if (ACPI_SUCCESS(status)) {
  428. sleep_type_reg_info =
  429. acpi_hw_get_bit_register_info(ACPI_BITREG_SLEEP_TYPE_A);
  430. sleep_enable_reg_info =
  431. acpi_hw_get_bit_register_info(ACPI_BITREG_SLEEP_ENABLE);
  432. /* Get current value of PM1A control */
  433. status = acpi_hw_register_read(ACPI_MTX_DO_NOT_LOCK,
  434. ACPI_REGISTER_PM1_CONTROL,
  435. &PM1Acontrol);
  436. if (ACPI_SUCCESS(status)) {
  437. /* Clear SLP_EN and SLP_TYP fields */
  438. PM1Acontrol &= ~(sleep_type_reg_info->access_bit_mask |
  439. sleep_enable_reg_info->
  440. access_bit_mask);
  441. PM1Bcontrol = PM1Acontrol;
  442. /* Insert SLP_TYP bits */
  443. PM1Acontrol |=
  444. (acpi_gbl_sleep_type_a << sleep_type_reg_info->
  445. bit_position);
  446. PM1Bcontrol |=
  447. (acpi_gbl_sleep_type_b << sleep_type_reg_info->
  448. bit_position);
  449. /* Just ignore any errors */
  450. (void)acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK,
  451. ACPI_REGISTER_PM1A_CONTROL,
  452. PM1Acontrol);
  453. (void)acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK,
  454. ACPI_REGISTER_PM1B_CONTROL,
  455. PM1Bcontrol);
  456. }
  457. }
  458. /* Ensure enter_sleep_state_prep -> enter_sleep_state ordering */
  459. acpi_gbl_sleep_type_a = ACPI_SLEEP_TYPE_INVALID;
  460. /* Setup parameter object */
  461. arg_list.count = 1;
  462. arg_list.pointer = &arg;
  463. arg.type = ACPI_TYPE_INTEGER;
  464. /* Ignore any errors from these methods */
  465. arg.integer.value = ACPI_SST_WAKING;
  466. status = acpi_evaluate_object(NULL, METHOD_NAME__SST, &arg_list, NULL);
  467. if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) {
  468. ACPI_EXCEPTION((AE_INFO, status, "During Method _SST"));
  469. }
  470. arg.integer.value = sleep_state;
  471. status = acpi_evaluate_object(NULL, METHOD_NAME__BFS, &arg_list, NULL);
  472. if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) {
  473. ACPI_EXCEPTION((AE_INFO, status, "During Method _BFS"));
  474. }
  475. status = acpi_evaluate_object(NULL, METHOD_NAME__WAK, &arg_list, NULL);
  476. if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) {
  477. ACPI_EXCEPTION((AE_INFO, status, "During Method _WAK"));
  478. }
  479. /* TBD: _WAK "sometimes" returns stuff - do we want to look at it? */
  480. /*
  481. * Restore the GPEs:
  482. * 1) Disable/Clear all GPEs
  483. * 2) Enable all runtime GPEs
  484. */
  485. status = acpi_hw_disable_all_gpes();
  486. if (ACPI_FAILURE(status)) {
  487. return_ACPI_STATUS(status);
  488. }
  489. acpi_gbl_system_awake_and_running = TRUE;
  490. status = acpi_hw_enable_all_runtime_gpes();
  491. if (ACPI_FAILURE(status)) {
  492. return_ACPI_STATUS(status);
  493. }
  494. /* Enable power button */
  495. (void)
  496. acpi_set_register(acpi_gbl_fixed_event_info
  497. [ACPI_EVENT_POWER_BUTTON].enable_register_id, 1);
  498. (void)
  499. acpi_set_register(acpi_gbl_fixed_event_info
  500. [ACPI_EVENT_POWER_BUTTON].status_register_id, 1);
  501. arg.integer.value = ACPI_SST_WORKING;
  502. status = acpi_evaluate_object(NULL, METHOD_NAME__SST, &arg_list, NULL);
  503. if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) {
  504. ACPI_EXCEPTION((AE_INFO, status, "During Method _SST"));
  505. }
  506. return_ACPI_STATUS(status);
  507. }
  508. ACPI_EXPORT_SYMBOL(acpi_leave_sleep_state)