aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpica/hwxfsleep.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/acpica/hwxfsleep.c')
-rw-r--r--drivers/acpi/acpica/hwxfsleep.c35
1 files changed, 20 insertions, 15 deletions
diff --git a/drivers/acpi/acpica/hwxfsleep.c b/drivers/acpi/acpica/hwxfsleep.c
index cf0168e538d9..762d059bb508 100644
--- a/drivers/acpi/acpica/hwxfsleep.c
+++ b/drivers/acpi/acpica/hwxfsleep.c
@@ -49,15 +49,16 @@
49ACPI_MODULE_NAME("hwxfsleep") 49ACPI_MODULE_NAME("hwxfsleep")
50 50
51/* Local prototypes */ 51/* Local prototypes */
52static acpi_status acpi_hw_sleep_dispatch(u8 sleep_state, u32 function_id); 52static acpi_status
53acpi_hw_sleep_dispatch(u8 sleep_state, u8 flags, u32 function_id);
53 54
54/* 55/*
55 * Dispatch table used to efficiently branch to the various sleep 56 * Dispatch table used to efficiently branch to the various sleep
56 * functions. 57 * functions.
57 */ 58 */
58#define ACPI_SLEEP_FUNCTION 0 59#define ACPI_SLEEP_FUNCTION_ID 0
59#define ACPI_WAKE_PREP_FUNCTION 1 60#define ACPI_WAKE_PREP_FUNCTION_ID 1
60#define ACPI_WAKE_FUNCTION 2 61#define ACPI_WAKE_FUNCTION_ID 2
61 62
62/* Legacy functions are optional, based upon ACPI_REDUCED_HARDWARE */ 63/* Legacy functions are optional, based upon ACPI_REDUCED_HARDWARE */
63 64
@@ -233,7 +234,8 @@ ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state_s4bios)
233 * function. 234 * function.
234 * 235 *
235 ******************************************************************************/ 236 ******************************************************************************/
236static acpi_status acpi_hw_sleep_dispatch(u8 sleep_state, u32 function_id) 237static acpi_status
238acpi_hw_sleep_dispatch(u8 sleep_state, u8 flags, u32 function_id)
237{ 239{
238 acpi_status status; 240 acpi_status status;
239 struct acpi_sleep_functions *sleep_functions = 241 struct acpi_sleep_functions *sleep_functions =
@@ -246,11 +248,11 @@ static acpi_status acpi_hw_sleep_dispatch(u8 sleep_state, u32 function_id)
246 * use the extended sleep registers 248 * use the extended sleep registers
247 */ 249 */
248 if (acpi_gbl_reduced_hardware || acpi_gbl_FADT.sleep_control.address) { 250 if (acpi_gbl_reduced_hardware || acpi_gbl_FADT.sleep_control.address) {
249 status = sleep_functions->extended_function(sleep_state); 251 status = sleep_functions->extended_function(sleep_state, flags);
250 } else { 252 } else {
251 /* Legacy sleep */ 253 /* Legacy sleep */
252 254
253 status = sleep_functions->legacy_function(sleep_state); 255 status = sleep_functions->legacy_function(sleep_state, flags);
254 } 256 }
255 257
256 return (status); 258 return (status);
@@ -260,7 +262,7 @@ static acpi_status acpi_hw_sleep_dispatch(u8 sleep_state, u32 function_id)
260 * For the case where reduced-hardware-only code is being generated, 262 * For the case where reduced-hardware-only code is being generated,
261 * we know that only the extended sleep registers are available 263 * we know that only the extended sleep registers are available
262 */ 264 */
263 status = sleep_functions->extended_function(sleep_state); 265 status = sleep_functions->extended_function(sleep_state, flags);
264 return (status); 266 return (status);
265 267
266#endif /* !ACPI_REDUCED_HARDWARE */ 268#endif /* !ACPI_REDUCED_HARDWARE */
@@ -290,8 +292,6 @@ acpi_status acpi_enter_sleep_state_prep(u8 sleep_state)
290 292
291 ACPI_FUNCTION_TRACE(acpi_enter_sleep_state_prep); 293 ACPI_FUNCTION_TRACE(acpi_enter_sleep_state_prep);
292 294
293 /* _PSW methods could be run here to enable wake-on keyboard, LAN, etc. */
294
295 status = acpi_get_sleep_type_data(sleep_state, 295 status = acpi_get_sleep_type_data(sleep_state,
296 &acpi_gbl_sleep_type_a, 296 &acpi_gbl_sleep_type_a,
297 &acpi_gbl_sleep_type_b); 297 &acpi_gbl_sleep_type_b);
@@ -349,6 +349,7 @@ ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state_prep)
349 * FUNCTION: acpi_enter_sleep_state 349 * FUNCTION: acpi_enter_sleep_state
350 * 350 *
351 * PARAMETERS: sleep_state - Which sleep state to enter 351 * PARAMETERS: sleep_state - Which sleep state to enter
352 * Flags - ACPI_EXECUTE_GTS to run optional method
352 * 353 *
353 * RETURN: Status 354 * RETURN: Status
354 * 355 *
@@ -356,7 +357,7 @@ ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state_prep)
356 * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED 357 * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED
357 * 358 *
358 ******************************************************************************/ 359 ******************************************************************************/
359acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state) 360acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state, u8 flags)
360{ 361{
361 acpi_status status; 362 acpi_status status;
362 363
@@ -369,7 +370,8 @@ acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state)
369 return_ACPI_STATUS(AE_AML_OPERAND_VALUE); 370 return_ACPI_STATUS(AE_AML_OPERAND_VALUE);
370 } 371 }
371 372
372 status = acpi_hw_sleep_dispatch(sleep_state, ACPI_SLEEP_FUNCTION); 373 status =
374 acpi_hw_sleep_dispatch(sleep_state, flags, ACPI_SLEEP_FUNCTION_ID);
373 return_ACPI_STATUS(status); 375 return_ACPI_STATUS(status);
374} 376}
375 377
@@ -380,6 +382,7 @@ ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state)
380 * FUNCTION: acpi_leave_sleep_state_prep 382 * FUNCTION: acpi_leave_sleep_state_prep
381 * 383 *
382 * PARAMETERS: sleep_state - Which sleep state we are exiting 384 * PARAMETERS: sleep_state - Which sleep state we are exiting
385 * Flags - ACPI_EXECUTE_BFS to run optional method
383 * 386 *
384 * RETURN: Status 387 * RETURN: Status
385 * 388 *
@@ -388,13 +391,15 @@ ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state)
388 * Called with interrupts DISABLED. 391 * Called with interrupts DISABLED.
389 * 392 *
390 ******************************************************************************/ 393 ******************************************************************************/
391acpi_status acpi_leave_sleep_state_prep(u8 sleep_state) 394acpi_status acpi_leave_sleep_state_prep(u8 sleep_state, u8 flags)
392{ 395{
393 acpi_status status; 396 acpi_status status;
394 397
395 ACPI_FUNCTION_TRACE(acpi_leave_sleep_state_prep); 398 ACPI_FUNCTION_TRACE(acpi_leave_sleep_state_prep);
396 399
397 status = acpi_hw_sleep_dispatch(sleep_state, ACPI_WAKE_PREP_FUNCTION); 400 status =
401 acpi_hw_sleep_dispatch(sleep_state, flags,
402 ACPI_WAKE_PREP_FUNCTION_ID);
398 return_ACPI_STATUS(status); 403 return_ACPI_STATUS(status);
399} 404}
400 405
@@ -419,7 +424,7 @@ acpi_status acpi_leave_sleep_state(u8 sleep_state)
419 ACPI_FUNCTION_TRACE(acpi_leave_sleep_state); 424 ACPI_FUNCTION_TRACE(acpi_leave_sleep_state);
420 425
421 426
422 status = acpi_hw_sleep_dispatch(sleep_state, ACPI_WAKE_FUNCTION); 427 status = acpi_hw_sleep_dispatch(sleep_state, 0, ACPI_WAKE_FUNCTION_ID);
423 return_ACPI_STATUS(status); 428 return_ACPI_STATUS(status);
424} 429}
425 430