hwsleep.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623
  1. /******************************************************************************
  2. *
  3. * Name: hwsleep.c - ACPI Hardware Sleep/Wake Interface
  4. *
  5. *****************************************************************************/
  6. /*
  7. * Copyright (C) 2000 - 2008, Intel Corp.
  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 "accommon.h"
  44. #include "actables.h"
  45. #define _COMPONENT ACPI_HARDWARE
  46. ACPI_MODULE_NAME("hwsleep")
  47. /*******************************************************************************
  48. *
  49. * FUNCTION: acpi_set_firmware_waking_vector
  50. *
  51. * PARAMETERS: physical_address - 32-bit physical address of ACPI real mode
  52. * entry point.
  53. *
  54. * RETURN: Status
  55. *
  56. * DESCRIPTION: Sets the 32-bit firmware_waking_vector field of the FACS
  57. *
  58. ******************************************************************************/
  59. acpi_status
  60. acpi_set_firmware_waking_vector(u32 physical_address)
  61. {
  62. ACPI_FUNCTION_TRACE(acpi_set_firmware_waking_vector);
  63. /*
  64. * According to the ACPI specification 2.0c and later, the 64-bit
  65. * waking vector should be cleared and the 32-bit waking vector should
  66. * be used, unless we want the wake-up code to be called by the BIOS in
  67. * Protected Mode. Some systems (for example HP dv5-1004nr) are known
  68. * to fail to resume if the 64-bit vector is used.
  69. */
  70. /* Set the 32-bit vector */
  71. acpi_gbl_FACS->firmware_waking_vector = physical_address;
  72. /* Clear the 64-bit vector if it exists */
  73. if ((acpi_gbl_FACS->length > 32) && (acpi_gbl_FACS->version >= 1)) {
  74. acpi_gbl_FACS->xfirmware_waking_vector = 0;
  75. }
  76. return_ACPI_STATUS(AE_OK);
  77. }
  78. ACPI_EXPORT_SYMBOL(acpi_set_firmware_waking_vector)
  79. #if ACPI_MACHINE_WIDTH == 64
  80. /*******************************************************************************
  81. *
  82. * FUNCTION: acpi_set_firmware_waking_vector64
  83. *
  84. * PARAMETERS: physical_address - 64-bit physical address of ACPI protected
  85. * mode entry point.
  86. *
  87. * RETURN: Status
  88. *
  89. * DESCRIPTION: Sets the 64-bit X_firmware_waking_vector field of the FACS, if
  90. * it exists in the table. This function is intended for use with
  91. * 64-bit host operating systems.
  92. *
  93. ******************************************************************************/
  94. acpi_status
  95. acpi_set_firmware_waking_vector64(u64 physical_address)
  96. {
  97. ACPI_FUNCTION_TRACE(acpi_set_firmware_waking_vector64);
  98. /* Determine if the 64-bit vector actually exists */
  99. if ((acpi_gbl_FACS->length <= 32) || (acpi_gbl_FACS->version < 1)) {
  100. return_ACPI_STATUS(AE_NOT_EXIST);
  101. }
  102. /* Clear 32-bit vector, set the 64-bit X_ vector */
  103. acpi_gbl_FACS->firmware_waking_vector = 0;
  104. acpi_gbl_FACS->xfirmware_waking_vector = physical_address;
  105. return_ACPI_STATUS(AE_OK);
  106. }
  107. ACPI_EXPORT_SYMBOL(acpi_set_firmware_waking_vector64)
  108. #endif
  109. /*******************************************************************************
  110. *
  111. * FUNCTION: acpi_enter_sleep_state_prep
  112. *
  113. * PARAMETERS: sleep_state - Which sleep state to enter
  114. *
  115. * RETURN: Status
  116. *
  117. * DESCRIPTION: Prepare to enter a system sleep state (see ACPI 2.0 spec p 231)
  118. * This function must execute with interrupts enabled.
  119. * We break sleeping into 2 stages so that OSPM can handle
  120. * various OS-specific tasks between the two steps.
  121. *
  122. ******************************************************************************/
  123. acpi_status acpi_enter_sleep_state_prep(u8 sleep_state)
  124. {
  125. acpi_status status;
  126. struct acpi_object_list arg_list;
  127. union acpi_object arg;
  128. ACPI_FUNCTION_TRACE(acpi_enter_sleep_state_prep);
  129. /* _PSW methods could be run here to enable wake-on keyboard, LAN, etc. */
  130. status = acpi_get_sleep_type_data(sleep_state,
  131. &acpi_gbl_sleep_type_a,
  132. &acpi_gbl_sleep_type_b);
  133. if (ACPI_FAILURE(status)) {
  134. return_ACPI_STATUS(status);
  135. }
  136. /* Setup parameter object */
  137. arg_list.count = 1;
  138. arg_list.pointer = &arg;
  139. arg.type = ACPI_TYPE_INTEGER;
  140. arg.integer.value = sleep_state;
  141. /* Run the _PTS method */
  142. status = acpi_evaluate_object(NULL, METHOD_NAME__PTS, &arg_list, NULL);
  143. if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) {
  144. return_ACPI_STATUS(status);
  145. }
  146. /* Setup the argument to _SST */
  147. switch (sleep_state) {
  148. case ACPI_STATE_S0:
  149. arg.integer.value = ACPI_SST_WORKING;
  150. break;
  151. case ACPI_STATE_S1:
  152. case ACPI_STATE_S2:
  153. case ACPI_STATE_S3:
  154. arg.integer.value = ACPI_SST_SLEEPING;
  155. break;
  156. case ACPI_STATE_S4:
  157. arg.integer.value = ACPI_SST_SLEEP_CONTEXT;
  158. break;
  159. default:
  160. arg.integer.value = ACPI_SST_INDICATOR_OFF; /* Default is off */
  161. break;
  162. }
  163. /*
  164. * Set the system indicators to show the desired sleep state.
  165. * _SST is an optional method (return no error if not found)
  166. */
  167. status = acpi_evaluate_object(NULL, METHOD_NAME__SST, &arg_list, NULL);
  168. if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) {
  169. ACPI_EXCEPTION((AE_INFO, status,
  170. "While executing method _SST"));
  171. }
  172. return_ACPI_STATUS(AE_OK);
  173. }
  174. ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state_prep)
  175. /*******************************************************************************
  176. *
  177. * FUNCTION: acpi_enter_sleep_state
  178. *
  179. * PARAMETERS: sleep_state - Which sleep state to enter
  180. *
  181. * RETURN: Status
  182. *
  183. * DESCRIPTION: Enter a system sleep state (see ACPI 2.0 spec p 231)
  184. * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED
  185. *
  186. ******************************************************************************/
  187. acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state)
  188. {
  189. u32 pm1a_control;
  190. u32 pm1b_control;
  191. struct acpi_bit_register_info *sleep_type_reg_info;
  192. struct acpi_bit_register_info *sleep_enable_reg_info;
  193. u32 in_value;
  194. struct acpi_object_list arg_list;
  195. union acpi_object arg;
  196. acpi_status status;
  197. ACPI_FUNCTION_TRACE(acpi_enter_sleep_state);
  198. if ((acpi_gbl_sleep_type_a > ACPI_SLEEP_TYPE_MAX) ||
  199. (acpi_gbl_sleep_type_b > ACPI_SLEEP_TYPE_MAX)) {
  200. ACPI_ERROR((AE_INFO, "Sleep values out of range: A=%X B=%X",
  201. acpi_gbl_sleep_type_a, acpi_gbl_sleep_type_b));
  202. return_ACPI_STATUS(AE_AML_OPERAND_VALUE);
  203. }
  204. sleep_type_reg_info =
  205. acpi_hw_get_bit_register_info(ACPI_BITREG_SLEEP_TYPE);
  206. sleep_enable_reg_info =
  207. acpi_hw_get_bit_register_info(ACPI_BITREG_SLEEP_ENABLE);
  208. /* Clear wake status */
  209. status =
  210. acpi_write_bit_register(ACPI_BITREG_WAKE_STATUS, ACPI_CLEAR_STATUS);
  211. if (ACPI_FAILURE(status)) {
  212. return_ACPI_STATUS(status);
  213. }
  214. /* Clear all fixed and general purpose status bits */
  215. status = acpi_hw_clear_acpi_status();
  216. if (ACPI_FAILURE(status)) {
  217. return_ACPI_STATUS(status);
  218. }
  219. /*
  220. * 1) Disable/Clear all GPEs
  221. * 2) Enable all wakeup GPEs
  222. */
  223. status = acpi_hw_disable_all_gpes();
  224. if (ACPI_FAILURE(status)) {
  225. return_ACPI_STATUS(status);
  226. }
  227. acpi_gbl_system_awake_and_running = FALSE;
  228. status = acpi_hw_enable_all_wakeup_gpes();
  229. if (ACPI_FAILURE(status)) {
  230. return_ACPI_STATUS(status);
  231. }
  232. /* Execute the _GTS method */
  233. arg_list.count = 1;
  234. arg_list.pointer = &arg;
  235. arg.type = ACPI_TYPE_INTEGER;
  236. arg.integer.value = sleep_state;
  237. status = acpi_evaluate_object(NULL, METHOD_NAME__GTS, &arg_list, NULL);
  238. if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) {
  239. return_ACPI_STATUS(status);
  240. }
  241. /* Get current value of PM1A control */
  242. status = acpi_hw_register_read(ACPI_REGISTER_PM1_CONTROL,
  243. &pm1a_control);
  244. if (ACPI_FAILURE(status)) {
  245. return_ACPI_STATUS(status);
  246. }
  247. ACPI_DEBUG_PRINT((ACPI_DB_INIT,
  248. "Entering sleep state [S%d]\n", sleep_state));
  249. /* Clear the SLP_EN and SLP_TYP fields */
  250. pm1a_control &= ~(sleep_type_reg_info->access_bit_mask |
  251. sleep_enable_reg_info->access_bit_mask);
  252. pm1b_control = pm1a_control;
  253. /* Insert the SLP_TYP bits */
  254. pm1a_control |=
  255. (acpi_gbl_sleep_type_a << sleep_type_reg_info->bit_position);
  256. pm1b_control |=
  257. (acpi_gbl_sleep_type_b << sleep_type_reg_info->bit_position);
  258. /*
  259. * We split the writes of SLP_TYP and SLP_EN to workaround
  260. * poorly implemented hardware.
  261. */
  262. /* Write #1: write the SLP_TYP data to the PM1 Control registers */
  263. status = acpi_hw_write_pm1_control(pm1a_control, pm1b_control);
  264. if (ACPI_FAILURE(status)) {
  265. return_ACPI_STATUS(status);
  266. }
  267. /* Insert the sleep enable (SLP_EN) bit */
  268. pm1a_control |= sleep_enable_reg_info->access_bit_mask;
  269. pm1b_control |= sleep_enable_reg_info->access_bit_mask;
  270. /* Flush caches, as per ACPI specification */
  271. ACPI_FLUSH_CPU_CACHE();
  272. /* Write #2: Write both SLP_TYP + SLP_EN */
  273. status = acpi_hw_write_pm1_control(pm1a_control, pm1b_control);
  274. if (ACPI_FAILURE(status)) {
  275. return_ACPI_STATUS(status);
  276. }
  277. if (sleep_state > ACPI_STATE_S3) {
  278. /*
  279. * We wanted to sleep > S3, but it didn't happen (by virtue of the
  280. * fact that we are still executing!)
  281. *
  282. * Wait ten seconds, then try again. This is to get S4/S5 to work on
  283. * all machines.
  284. *
  285. * We wait so long to allow chipsets that poll this reg very slowly
  286. * to still read the right value. Ideally, this block would go
  287. * away entirely.
  288. */
  289. acpi_os_stall(10000000);
  290. status = acpi_hw_register_write(ACPI_REGISTER_PM1_CONTROL,
  291. sleep_enable_reg_info->
  292. access_bit_mask);
  293. if (ACPI_FAILURE(status)) {
  294. return_ACPI_STATUS(status);
  295. }
  296. }
  297. /* Wait until we enter sleep state */
  298. do {
  299. status = acpi_read_bit_register(ACPI_BITREG_WAKE_STATUS,
  300. &in_value);
  301. if (ACPI_FAILURE(status)) {
  302. return_ACPI_STATUS(status);
  303. }
  304. /* Spin until we wake */
  305. } while (!in_value);
  306. return_ACPI_STATUS(AE_OK);
  307. }
  308. ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state)
  309. /*******************************************************************************
  310. *
  311. * FUNCTION: acpi_enter_sleep_state_s4bios
  312. *
  313. * PARAMETERS: None
  314. *
  315. * RETURN: Status
  316. *
  317. * DESCRIPTION: Perform a S4 bios request.
  318. * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED
  319. *
  320. ******************************************************************************/
  321. acpi_status asmlinkage acpi_enter_sleep_state_s4bios(void)
  322. {
  323. u32 in_value;
  324. acpi_status status;
  325. ACPI_FUNCTION_TRACE(acpi_enter_sleep_state_s4bios);
  326. /* Clear the wake status bit (PM1) */
  327. status =
  328. acpi_write_bit_register(ACPI_BITREG_WAKE_STATUS, ACPI_CLEAR_STATUS);
  329. if (ACPI_FAILURE(status)) {
  330. return_ACPI_STATUS(status);
  331. }
  332. status = acpi_hw_clear_acpi_status();
  333. if (ACPI_FAILURE(status)) {
  334. return_ACPI_STATUS(status);
  335. }
  336. /*
  337. * 1) Disable/Clear all GPEs
  338. * 2) Enable all wakeup GPEs
  339. */
  340. status = acpi_hw_disable_all_gpes();
  341. if (ACPI_FAILURE(status)) {
  342. return_ACPI_STATUS(status);
  343. }
  344. acpi_gbl_system_awake_and_running = FALSE;
  345. status = acpi_hw_enable_all_wakeup_gpes();
  346. if (ACPI_FAILURE(status)) {
  347. return_ACPI_STATUS(status);
  348. }
  349. ACPI_FLUSH_CPU_CACHE();
  350. status = acpi_hw_write_port(acpi_gbl_FADT.smi_command,
  351. (u32) acpi_gbl_FADT.S4bios_request, 8);
  352. do {
  353. acpi_os_stall(1000);
  354. status =
  355. acpi_read_bit_register(ACPI_BITREG_WAKE_STATUS, &in_value);
  356. if (ACPI_FAILURE(status)) {
  357. return_ACPI_STATUS(status);
  358. }
  359. } while (!in_value);
  360. return_ACPI_STATUS(AE_OK);
  361. }
  362. ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state_s4bios)
  363. /*******************************************************************************
  364. *
  365. * FUNCTION: acpi_leave_sleep_state_prep
  366. *
  367. * PARAMETERS: sleep_state - Which sleep state we are exiting
  368. *
  369. * RETURN: Status
  370. *
  371. * DESCRIPTION: Perform the first state of OS-independent ACPI cleanup after a
  372. * sleep.
  373. * Called with interrupts DISABLED.
  374. *
  375. ******************************************************************************/
  376. acpi_status acpi_leave_sleep_state_prep(u8 sleep_state)
  377. {
  378. struct acpi_object_list arg_list;
  379. union acpi_object arg;
  380. acpi_status status;
  381. struct acpi_bit_register_info *sleep_type_reg_info;
  382. struct acpi_bit_register_info *sleep_enable_reg_info;
  383. u32 pm1a_control;
  384. u32 pm1b_control;
  385. ACPI_FUNCTION_TRACE(acpi_leave_sleep_state_prep);
  386. /*
  387. * Set SLP_TYPE and SLP_EN to state S0.
  388. * This is unclear from the ACPI Spec, but it is required
  389. * by some machines.
  390. */
  391. status = acpi_get_sleep_type_data(ACPI_STATE_S0,
  392. &acpi_gbl_sleep_type_a,
  393. &acpi_gbl_sleep_type_b);
  394. if (ACPI_SUCCESS(status)) {
  395. sleep_type_reg_info =
  396. acpi_hw_get_bit_register_info(ACPI_BITREG_SLEEP_TYPE);
  397. sleep_enable_reg_info =
  398. acpi_hw_get_bit_register_info(ACPI_BITREG_SLEEP_ENABLE);
  399. /* Get current value of PM1A control */
  400. status = acpi_hw_register_read(ACPI_REGISTER_PM1_CONTROL,
  401. &pm1a_control);
  402. if (ACPI_SUCCESS(status)) {
  403. /* Clear the SLP_EN and SLP_TYP fields */
  404. pm1a_control &= ~(sleep_type_reg_info->access_bit_mask |
  405. sleep_enable_reg_info->
  406. access_bit_mask);
  407. pm1b_control = pm1a_control;
  408. /* Insert the SLP_TYP bits */
  409. pm1a_control |= (acpi_gbl_sleep_type_a <<
  410. sleep_type_reg_info->bit_position);
  411. pm1b_control |= (acpi_gbl_sleep_type_b <<
  412. sleep_type_reg_info->bit_position);
  413. /* Write the control registers and ignore any errors */
  414. (void)acpi_hw_write_pm1_control(pm1a_control,
  415. pm1b_control);
  416. }
  417. }
  418. /* Execute the _BFS method */
  419. arg_list.count = 1;
  420. arg_list.pointer = &arg;
  421. arg.type = ACPI_TYPE_INTEGER;
  422. arg.integer.value = sleep_state;
  423. status = acpi_evaluate_object(NULL, METHOD_NAME__BFS, &arg_list, NULL);
  424. if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) {
  425. ACPI_EXCEPTION((AE_INFO, status, "During Method _BFS"));
  426. }
  427. return_ACPI_STATUS(status);
  428. }
  429. /*******************************************************************************
  430. *
  431. * FUNCTION: acpi_leave_sleep_state
  432. *
  433. * PARAMETERS: sleep_state - Which sleep state we just exited
  434. *
  435. * RETURN: Status
  436. *
  437. * DESCRIPTION: Perform OS-independent ACPI cleanup after a sleep
  438. * Called with interrupts ENABLED.
  439. *
  440. ******************************************************************************/
  441. acpi_status acpi_leave_sleep_state(u8 sleep_state)
  442. {
  443. struct acpi_object_list arg_list;
  444. union acpi_object arg;
  445. acpi_status status;
  446. ACPI_FUNCTION_TRACE(acpi_leave_sleep_state);
  447. /* Ensure enter_sleep_state_prep -> enter_sleep_state ordering */
  448. acpi_gbl_sleep_type_a = ACPI_SLEEP_TYPE_INVALID;
  449. /* Setup parameter object */
  450. arg_list.count = 1;
  451. arg_list.pointer = &arg;
  452. arg.type = ACPI_TYPE_INTEGER;
  453. /* Ignore any errors from these methods */
  454. arg.integer.value = ACPI_SST_WAKING;
  455. status = acpi_evaluate_object(NULL, METHOD_NAME__SST, &arg_list, NULL);
  456. if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) {
  457. ACPI_EXCEPTION((AE_INFO, status, "During Method _SST"));
  458. }
  459. /*
  460. * GPEs must be enabled before _WAK is called as GPEs
  461. * might get fired there
  462. *
  463. * Restore the GPEs:
  464. * 1) Disable/Clear all GPEs
  465. * 2) Enable all runtime GPEs
  466. */
  467. status = acpi_hw_disable_all_gpes();
  468. if (ACPI_FAILURE(status)) {
  469. return_ACPI_STATUS(status);
  470. }
  471. status = acpi_hw_enable_all_runtime_gpes();
  472. if (ACPI_FAILURE(status)) {
  473. return_ACPI_STATUS(status);
  474. }
  475. arg.integer.value = sleep_state;
  476. status = acpi_evaluate_object(NULL, METHOD_NAME__WAK, &arg_list, NULL);
  477. if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) {
  478. ACPI_EXCEPTION((AE_INFO, status, "During Method _WAK"));
  479. }
  480. /* TBD: _WAK "sometimes" returns stuff - do we want to look at it? */
  481. /*
  482. * Some BIOSes assume that WAK_STS will be cleared on resume and use
  483. * it to determine whether the system is rebooting or resuming. Clear
  484. * it for compatibility.
  485. */
  486. acpi_write_bit_register(ACPI_BITREG_WAKE_STATUS, 1);
  487. acpi_gbl_system_awake_and_running = TRUE;
  488. /* Enable power button */
  489. (void)
  490. acpi_write_bit_register(acpi_gbl_fixed_event_info
  491. [ACPI_EVENT_POWER_BUTTON].
  492. enable_register_id, ACPI_ENABLE_EVENT);
  493. (void)
  494. acpi_write_bit_register(acpi_gbl_fixed_event_info
  495. [ACPI_EVENT_POWER_BUTTON].
  496. status_register_id, ACPI_CLEAR_STATUS);
  497. arg.integer.value = ACPI_SST_WORKING;
  498. status = acpi_evaluate_object(NULL, METHOD_NAME__SST, &arg_list, NULL);
  499. if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) {
  500. ACPI_EXCEPTION((AE_INFO, status, "During Method _SST"));
  501. }
  502. return_ACPI_STATUS(status);
  503. }
  504. ACPI_EXPORT_SYMBOL(acpi_leave_sleep_state)