diff options
Diffstat (limited to 'drivers/acpi/hardware/hwsleep.c')
-rw-r--r-- | drivers/acpi/hardware/hwsleep.c | 40 |
1 files changed, 14 insertions, 26 deletions
diff --git a/drivers/acpi/hardware/hwsleep.c b/drivers/acpi/hardware/hwsleep.c index cf69c0040a39..81b248429703 100644 --- a/drivers/acpi/hardware/hwsleep.c +++ b/drivers/acpi/hardware/hwsleep.c | |||
@@ -234,15 +234,11 @@ acpi_status acpi_enter_sleep_state_prep(u8 sleep_state) | |||
234 | "While executing method _SST")); | 234 | "While executing method _SST")); |
235 | } | 235 | } |
236 | 236 | ||
237 | /* | 237 | /* Disable/Clear all GPEs */ |
238 | * 1) Disable/Clear all GPEs | 238 | |
239 | */ | ||
240 | status = acpi_hw_disable_all_gpes(); | 239 | status = acpi_hw_disable_all_gpes(); |
241 | if (ACPI_FAILURE(status)) { | ||
242 | return_ACPI_STATUS(status); | ||
243 | } | ||
244 | 240 | ||
245 | return_ACPI_STATUS(AE_OK); | 241 | return_ACPI_STATUS(status); |
246 | } | 242 | } |
247 | 243 | ||
248 | ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state_prep) | 244 | ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state_prep) |
@@ -313,8 +309,7 @@ acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state) | |||
313 | 309 | ||
314 | /* Get current value of PM1A control */ | 310 | /* Get current value of PM1A control */ |
315 | 311 | ||
316 | status = acpi_hw_register_read(ACPI_MTX_DO_NOT_LOCK, | 312 | status = acpi_hw_register_read(ACPI_REGISTER_PM1_CONTROL, &PM1Acontrol); |
317 | ACPI_REGISTER_PM1_CONTROL, &PM1Acontrol); | ||
318 | if (ACPI_FAILURE(status)) { | 313 | if (ACPI_FAILURE(status)) { |
319 | return_ACPI_STATUS(status); | 314 | return_ACPI_STATUS(status); |
320 | } | 315 | } |
@@ -341,15 +336,13 @@ acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state) | |||
341 | 336 | ||
342 | /* Write #1: fill in SLP_TYP data */ | 337 | /* Write #1: fill in SLP_TYP data */ |
343 | 338 | ||
344 | status = acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK, | 339 | status = acpi_hw_register_write(ACPI_REGISTER_PM1A_CONTROL, |
345 | ACPI_REGISTER_PM1A_CONTROL, | ||
346 | PM1Acontrol); | 340 | PM1Acontrol); |
347 | if (ACPI_FAILURE(status)) { | 341 | if (ACPI_FAILURE(status)) { |
348 | return_ACPI_STATUS(status); | 342 | return_ACPI_STATUS(status); |
349 | } | 343 | } |
350 | 344 | ||
351 | status = acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK, | 345 | status = acpi_hw_register_write(ACPI_REGISTER_PM1B_CONTROL, |
352 | ACPI_REGISTER_PM1B_CONTROL, | ||
353 | PM1Bcontrol); | 346 | PM1Bcontrol); |
354 | if (ACPI_FAILURE(status)) { | 347 | if (ACPI_FAILURE(status)) { |
355 | return_ACPI_STATUS(status); | 348 | return_ACPI_STATUS(status); |
@@ -364,15 +357,13 @@ acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state) | |||
364 | 357 | ||
365 | ACPI_FLUSH_CPU_CACHE(); | 358 | ACPI_FLUSH_CPU_CACHE(); |
366 | 359 | ||
367 | status = acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK, | 360 | status = acpi_hw_register_write(ACPI_REGISTER_PM1A_CONTROL, |
368 | ACPI_REGISTER_PM1A_CONTROL, | ||
369 | PM1Acontrol); | 361 | PM1Acontrol); |
370 | if (ACPI_FAILURE(status)) { | 362 | if (ACPI_FAILURE(status)) { |
371 | return_ACPI_STATUS(status); | 363 | return_ACPI_STATUS(status); |
372 | } | 364 | } |
373 | 365 | ||
374 | status = acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK, | 366 | status = acpi_hw_register_write(ACPI_REGISTER_PM1B_CONTROL, |
375 | ACPI_REGISTER_PM1B_CONTROL, | ||
376 | PM1Bcontrol); | 367 | PM1Bcontrol); |
377 | if (ACPI_FAILURE(status)) { | 368 | if (ACPI_FAILURE(status)) { |
378 | return_ACPI_STATUS(status); | 369 | return_ACPI_STATUS(status); |
@@ -392,8 +383,7 @@ acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state) | |||
392 | */ | 383 | */ |
393 | acpi_os_stall(10000000); | 384 | acpi_os_stall(10000000); |
394 | 385 | ||
395 | status = acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK, | 386 | status = acpi_hw_register_write(ACPI_REGISTER_PM1_CONTROL, |
396 | ACPI_REGISTER_PM1_CONTROL, | ||
397 | sleep_enable_reg_info-> | 387 | sleep_enable_reg_info-> |
398 | access_bit_mask); | 388 | access_bit_mask); |
399 | if (ACPI_FAILURE(status)) { | 389 | if (ACPI_FAILURE(status)) { |
@@ -404,7 +394,8 @@ acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state) | |||
404 | /* Wait until we enter sleep state */ | 394 | /* Wait until we enter sleep state */ |
405 | 395 | ||
406 | do { | 396 | do { |
407 | status = acpi_get_register(ACPI_BITREG_WAKE_STATUS, &in_value); | 397 | status = acpi_get_register_unlocked(ACPI_BITREG_WAKE_STATUS, |
398 | &in_value); | ||
408 | if (ACPI_FAILURE(status)) { | 399 | if (ACPI_FAILURE(status)) { |
409 | return_ACPI_STATUS(status); | 400 | return_ACPI_STATUS(status); |
410 | } | 401 | } |
@@ -520,8 +511,7 @@ acpi_status acpi_leave_sleep_state(u8 sleep_state) | |||
520 | 511 | ||
521 | /* Get current value of PM1A control */ | 512 | /* Get current value of PM1A control */ |
522 | 513 | ||
523 | status = acpi_hw_register_read(ACPI_MTX_DO_NOT_LOCK, | 514 | status = acpi_hw_register_read(ACPI_REGISTER_PM1_CONTROL, |
524 | ACPI_REGISTER_PM1_CONTROL, | ||
525 | &PM1Acontrol); | 515 | &PM1Acontrol); |
526 | if (ACPI_SUCCESS(status)) { | 516 | if (ACPI_SUCCESS(status)) { |
527 | 517 | ||
@@ -543,11 +533,9 @@ acpi_status acpi_leave_sleep_state(u8 sleep_state) | |||
543 | 533 | ||
544 | /* Just ignore any errors */ | 534 | /* Just ignore any errors */ |
545 | 535 | ||
546 | (void)acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK, | 536 | (void)acpi_hw_register_write(ACPI_REGISTER_PM1A_CONTROL, |
547 | ACPI_REGISTER_PM1A_CONTROL, | ||
548 | PM1Acontrol); | 537 | PM1Acontrol); |
549 | (void)acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK, | 538 | (void)acpi_hw_register_write(ACPI_REGISTER_PM1B_CONTROL, |
550 | ACPI_REGISTER_PM1B_CONTROL, | ||
551 | PM1Bcontrol); | 539 | PM1Bcontrol); |
552 | } | 540 | } |
553 | } | 541 | } |