diff options
author | Alexey Starikovskiy <astarikovskiy@suse.de> | 2007-09-30 14:39:36 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2007-10-10 01:00:26 -0400 |
commit | d30dc9abb4aacfd4df3f486f22bcbc0531b73283 (patch) | |
tree | cb2d69e1b5fc00ad7a6691f362e814ddd6af61fa | |
parent | bbf25010f1a6b761914430f5fca081ec8c7accd1 (diff) |
ACPICA: hw: remove use_lock flag from acpi_hw_register_{read, write}
use_lock flag is used once for acpi_hw_register_read, and never for
acpi_hw_register_write. It will greatly simplify understanding of
locking if we just drop this use_lock altogether, and wrap the only call
to ..._read in lock/unlock.
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
-rw-r--r-- | drivers/acpi/events/evevent.c | 6 | ||||
-rw-r--r-- | drivers/acpi/hardware/hwregs.c | 89 | ||||
-rw-r--r-- | drivers/acpi/hardware/hwsleep.c | 27 | ||||
-rw-r--r-- | include/acpi/achware.h | 4 |
4 files changed, 48 insertions, 78 deletions
diff --git a/drivers/acpi/events/evevent.c b/drivers/acpi/events/evevent.c index a1f87b5def2a..e41287815ea1 100644 --- a/drivers/acpi/events/evevent.c +++ b/drivers/acpi/events/evevent.c | |||
@@ -239,10 +239,8 @@ u32 acpi_ev_fixed_event_detect(void) | |||
239 | * Read the fixed feature status and enable registers, as all the cases | 239 | * Read the fixed feature status and enable registers, as all the cases |
240 | * depend on their values. Ignore errors here. | 240 | * depend on their values. Ignore errors here. |
241 | */ | 241 | */ |
242 | (void)acpi_hw_register_read(ACPI_MTX_DO_NOT_LOCK, | 242 | (void)acpi_hw_register_read(ACPI_REGISTER_PM1_STATUS, &fixed_status); |
243 | ACPI_REGISTER_PM1_STATUS, &fixed_status); | 243 | (void)acpi_hw_register_read(ACPI_REGISTER_PM1_ENABLE, &fixed_enable); |
244 | (void)acpi_hw_register_read(ACPI_MTX_DO_NOT_LOCK, | ||
245 | ACPI_REGISTER_PM1_ENABLE, &fixed_enable); | ||
246 | 244 | ||
247 | ACPI_DEBUG_PRINT((ACPI_DB_INTERRUPTS, | 245 | ACPI_DEBUG_PRINT((ACPI_DB_INTERRUPTS, |
248 | "Fixed Event Block: Enable %08X Status %08X\n", | 246 | "Fixed Event Block: Enable %08X Status %08X\n", |
diff --git a/drivers/acpi/hardware/hwregs.c b/drivers/acpi/hardware/hwregs.c index 1d371fa663f2..73f9c5fb1ba7 100644 --- a/drivers/acpi/hardware/hwregs.c +++ b/drivers/acpi/hardware/hwregs.c | |||
@@ -75,8 +75,7 @@ acpi_status acpi_hw_clear_acpi_status(void) | |||
75 | 75 | ||
76 | lock_flags = acpi_os_acquire_lock(acpi_gbl_hardware_lock); | 76 | lock_flags = acpi_os_acquire_lock(acpi_gbl_hardware_lock); |
77 | 77 | ||
78 | status = acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK, | 78 | status = acpi_hw_register_write(ACPI_REGISTER_PM1_STATUS, |
79 | ACPI_REGISTER_PM1_STATUS, | ||
80 | ACPI_BITMASK_ALL_FIXED_STATUS); | 79 | ACPI_BITMASK_ALL_FIXED_STATUS); |
81 | if (ACPI_FAILURE(status)) { | 80 | if (ACPI_FAILURE(status)) { |
82 | goto unlock_and_exit; | 81 | goto unlock_and_exit; |
@@ -259,7 +258,7 @@ struct acpi_bit_register_info *acpi_hw_get_bit_register_info(u32 register_id) | |||
259 | * | 258 | * |
260 | ******************************************************************************/ | 259 | ******************************************************************************/ |
261 | 260 | ||
262 | acpi_status acpi_get_register(u32 register_id, u32 * return_value) | 261 | acpi_status acpi_get_register_unlocked(u32 register_id, u32 * return_value) |
263 | { | 262 | { |
264 | u32 register_value = 0; | 263 | u32 register_value = 0; |
265 | struct acpi_bit_register_info *bit_reg_info; | 264 | struct acpi_bit_register_info *bit_reg_info; |
@@ -276,8 +275,7 @@ acpi_status acpi_get_register(u32 register_id, u32 * return_value) | |||
276 | 275 | ||
277 | /* Read from the register */ | 276 | /* Read from the register */ |
278 | 277 | ||
279 | status = acpi_hw_register_read(ACPI_MTX_LOCK, | 278 | status = acpi_hw_register_read(bit_reg_info->parent_register, |
280 | bit_reg_info->parent_register, | ||
281 | ®ister_value); | 279 | ®ister_value); |
282 | 280 | ||
283 | if (ACPI_SUCCESS(status)) { | 281 | if (ACPI_SUCCESS(status)) { |
@@ -298,6 +296,16 @@ acpi_status acpi_get_register(u32 register_id, u32 * return_value) | |||
298 | return_ACPI_STATUS(status); | 296 | return_ACPI_STATUS(status); |
299 | } | 297 | } |
300 | 298 | ||
299 | acpi_status acpi_get_register(u32 register_id, u32 * return_value) | ||
300 | { | ||
301 | acpi_status status; | ||
302 | acpi_cpu_flags flags; | ||
303 | flags = acpi_os_acquire_lock(acpi_gbl_hardware_lock); | ||
304 | status = acpi_get_register_unlocked(register_id, return_value); | ||
305 | acpi_os_release_lock(acpi_gbl_hardware_lock, flags); | ||
306 | return status; | ||
307 | } | ||
308 | |||
301 | ACPI_EXPORT_SYMBOL(acpi_get_register) | 309 | ACPI_EXPORT_SYMBOL(acpi_get_register) |
302 | 310 | ||
303 | /******************************************************************************* | 311 | /******************************************************************************* |
@@ -335,8 +343,7 @@ acpi_status acpi_set_register(u32 register_id, u32 value) | |||
335 | 343 | ||
336 | /* Always do a register read first so we can insert the new bits */ | 344 | /* Always do a register read first so we can insert the new bits */ |
337 | 345 | ||
338 | status = acpi_hw_register_read(ACPI_MTX_DO_NOT_LOCK, | 346 | status = acpi_hw_register_read(bit_reg_info->parent_register, |
339 | bit_reg_info->parent_register, | ||
340 | ®ister_value); | 347 | ®ister_value); |
341 | if (ACPI_FAILURE(status)) { | 348 | if (ACPI_FAILURE(status)) { |
342 | goto unlock_and_exit; | 349 | goto unlock_and_exit; |
@@ -363,8 +370,7 @@ acpi_status acpi_set_register(u32 register_id, u32 value) | |||
363 | bit_reg_info-> | 370 | bit_reg_info-> |
364 | access_bit_mask); | 371 | access_bit_mask); |
365 | if (value) { | 372 | if (value) { |
366 | status = acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK, | 373 | status = acpi_hw_register_write(ACPI_REGISTER_PM1_STATUS, |
367 | ACPI_REGISTER_PM1_STATUS, | ||
368 | (u16) value); | 374 | (u16) value); |
369 | register_value = 0; | 375 | register_value = 0; |
370 | } | 376 | } |
@@ -377,8 +383,7 @@ acpi_status acpi_set_register(u32 register_id, u32 value) | |||
377 | bit_reg_info->access_bit_mask, | 383 | bit_reg_info->access_bit_mask, |
378 | value); | 384 | value); |
379 | 385 | ||
380 | status = acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK, | 386 | status = acpi_hw_register_write(ACPI_REGISTER_PM1_ENABLE, |
381 | ACPI_REGISTER_PM1_ENABLE, | ||
382 | (u16) register_value); | 387 | (u16) register_value); |
383 | break; | 388 | break; |
384 | 389 | ||
@@ -397,15 +402,13 @@ acpi_status acpi_set_register(u32 register_id, u32 value) | |||
397 | bit_reg_info->access_bit_mask, | 402 | bit_reg_info->access_bit_mask, |
398 | value); | 403 | value); |
399 | 404 | ||
400 | status = acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK, | 405 | status = acpi_hw_register_write(ACPI_REGISTER_PM1_CONTROL, |
401 | ACPI_REGISTER_PM1_CONTROL, | ||
402 | (u16) register_value); | 406 | (u16) register_value); |
403 | break; | 407 | break; |
404 | 408 | ||
405 | case ACPI_REGISTER_PM2_CONTROL: | 409 | case ACPI_REGISTER_PM2_CONTROL: |
406 | 410 | ||
407 | status = acpi_hw_register_read(ACPI_MTX_DO_NOT_LOCK, | 411 | status = acpi_hw_register_read(ACPI_REGISTER_PM2_CONTROL, |
408 | ACPI_REGISTER_PM2_CONTROL, | ||
409 | ®ister_value); | 412 | ®ister_value); |
410 | if (ACPI_FAILURE(status)) { | 413 | if (ACPI_FAILURE(status)) { |
411 | goto unlock_and_exit; | 414 | goto unlock_and_exit; |
@@ -430,8 +433,7 @@ acpi_status acpi_set_register(u32 register_id, u32 value) | |||
430 | xpm2_control_block. | 433 | xpm2_control_block. |
431 | address))); | 434 | address))); |
432 | 435 | ||
433 | status = acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK, | 436 | status = acpi_hw_register_write(ACPI_REGISTER_PM2_CONTROL, |
434 | ACPI_REGISTER_PM2_CONTROL, | ||
435 | (u8) (register_value)); | 437 | (u8) (register_value)); |
436 | break; | 438 | break; |
437 | 439 | ||
@@ -461,8 +463,7 @@ ACPI_EXPORT_SYMBOL(acpi_set_register) | |||
461 | * | 463 | * |
462 | * FUNCTION: acpi_hw_register_read | 464 | * FUNCTION: acpi_hw_register_read |
463 | * | 465 | * |
464 | * PARAMETERS: use_lock - Lock hardware? True/False | 466 | * PARAMETERS: register_id - ACPI Register ID |
465 | * register_id - ACPI Register ID | ||
466 | * return_value - Where the register value is returned | 467 | * return_value - Where the register value is returned |
467 | * | 468 | * |
468 | * RETURN: Status and the value read. | 469 | * RETURN: Status and the value read. |
@@ -471,19 +472,14 @@ ACPI_EXPORT_SYMBOL(acpi_set_register) | |||
471 | * | 472 | * |
472 | ******************************************************************************/ | 473 | ******************************************************************************/ |
473 | acpi_status | 474 | acpi_status |
474 | acpi_hw_register_read(u8 use_lock, u32 register_id, u32 * return_value) | 475 | acpi_hw_register_read(u32 register_id, u32 * return_value) |
475 | { | 476 | { |
476 | u32 value1 = 0; | 477 | u32 value1 = 0; |
477 | u32 value2 = 0; | 478 | u32 value2 = 0; |
478 | acpi_status status; | 479 | acpi_status status; |
479 | acpi_cpu_flags lock_flags = 0; | ||
480 | 480 | ||
481 | ACPI_FUNCTION_TRACE(hw_register_read); | 481 | ACPI_FUNCTION_TRACE(hw_register_read); |
482 | 482 | ||
483 | if (ACPI_MTX_LOCK == use_lock) { | ||
484 | lock_flags = acpi_os_acquire_lock(acpi_gbl_hardware_lock); | ||
485 | } | ||
486 | |||
487 | switch (register_id) { | 483 | switch (register_id) { |
488 | case ACPI_REGISTER_PM1_STATUS: /* 16-bit access */ | 484 | case ACPI_REGISTER_PM1_STATUS: /* 16-bit access */ |
489 | 485 | ||
@@ -491,7 +487,7 @@ acpi_hw_register_read(u8 use_lock, u32 register_id, u32 * return_value) | |||
491 | acpi_hw_low_level_read(16, &value1, | 487 | acpi_hw_low_level_read(16, &value1, |
492 | &acpi_gbl_FADT.xpm1a_event_block); | 488 | &acpi_gbl_FADT.xpm1a_event_block); |
493 | if (ACPI_FAILURE(status)) { | 489 | if (ACPI_FAILURE(status)) { |
494 | goto unlock_and_exit; | 490 | goto exit; |
495 | } | 491 | } |
496 | 492 | ||
497 | /* PM1B is optional */ | 493 | /* PM1B is optional */ |
@@ -507,7 +503,7 @@ acpi_hw_register_read(u8 use_lock, u32 register_id, u32 * return_value) | |||
507 | status = | 503 | status = |
508 | acpi_hw_low_level_read(16, &value1, &acpi_gbl_xpm1a_enable); | 504 | acpi_hw_low_level_read(16, &value1, &acpi_gbl_xpm1a_enable); |
509 | if (ACPI_FAILURE(status)) { | 505 | if (ACPI_FAILURE(status)) { |
510 | goto unlock_and_exit; | 506 | goto exit; |
511 | } | 507 | } |
512 | 508 | ||
513 | /* PM1B is optional */ | 509 | /* PM1B is optional */ |
@@ -523,7 +519,7 @@ acpi_hw_register_read(u8 use_lock, u32 register_id, u32 * return_value) | |||
523 | acpi_hw_low_level_read(16, &value1, | 519 | acpi_hw_low_level_read(16, &value1, |
524 | &acpi_gbl_FADT.xpm1a_control_block); | 520 | &acpi_gbl_FADT.xpm1a_control_block); |
525 | if (ACPI_FAILURE(status)) { | 521 | if (ACPI_FAILURE(status)) { |
526 | goto unlock_and_exit; | 522 | goto exit; |
527 | } | 523 | } |
528 | 524 | ||
529 | status = | 525 | status = |
@@ -558,10 +554,7 @@ acpi_hw_register_read(u8 use_lock, u32 register_id, u32 * return_value) | |||
558 | break; | 554 | break; |
559 | } | 555 | } |
560 | 556 | ||
561 | unlock_and_exit: | 557 | exit: |
562 | if (ACPI_MTX_LOCK == use_lock) { | ||
563 | acpi_os_release_lock(acpi_gbl_hardware_lock, lock_flags); | ||
564 | } | ||
565 | 558 | ||
566 | if (ACPI_SUCCESS(status)) { | 559 | if (ACPI_SUCCESS(status)) { |
567 | *return_value = value1; | 560 | *return_value = value1; |
@@ -574,8 +567,7 @@ acpi_hw_register_read(u8 use_lock, u32 register_id, u32 * return_value) | |||
574 | * | 567 | * |
575 | * FUNCTION: acpi_hw_register_write | 568 | * FUNCTION: acpi_hw_register_write |
576 | * | 569 | * |
577 | * PARAMETERS: use_lock - Lock hardware? True/False | 570 | * PARAMETERS: register_id - ACPI Register ID |
578 | * register_id - ACPI Register ID | ||
579 | * Value - The value to write | 571 | * Value - The value to write |
580 | * | 572 | * |
581 | * RETURN: Status | 573 | * RETURN: Status |
@@ -597,28 +589,22 @@ acpi_hw_register_read(u8 use_lock, u32 register_id, u32 * return_value) | |||
597 | * | 589 | * |
598 | ******************************************************************************/ | 590 | ******************************************************************************/ |
599 | 591 | ||
600 | acpi_status acpi_hw_register_write(u8 use_lock, u32 register_id, u32 value) | 592 | acpi_status acpi_hw_register_write(u32 register_id, u32 value) |
601 | { | 593 | { |
602 | acpi_status status; | 594 | acpi_status status; |
603 | acpi_cpu_flags lock_flags = 0; | ||
604 | u32 read_value; | 595 | u32 read_value; |
605 | 596 | ||
606 | ACPI_FUNCTION_TRACE(hw_register_write); | 597 | ACPI_FUNCTION_TRACE(hw_register_write); |
607 | 598 | ||
608 | if (ACPI_MTX_LOCK == use_lock) { | ||
609 | lock_flags = acpi_os_acquire_lock(acpi_gbl_hardware_lock); | ||
610 | } | ||
611 | |||
612 | switch (register_id) { | 599 | switch (register_id) { |
613 | case ACPI_REGISTER_PM1_STATUS: /* 16-bit access */ | 600 | case ACPI_REGISTER_PM1_STATUS: /* 16-bit access */ |
614 | 601 | ||
615 | /* Perform a read first to preserve certain bits (per ACPI spec) */ | 602 | /* Perform a read first to preserve certain bits (per ACPI spec) */ |
616 | 603 | ||
617 | status = acpi_hw_register_read(ACPI_MTX_DO_NOT_LOCK, | 604 | status = acpi_hw_register_read(ACPI_REGISTER_PM1_STATUS, |
618 | ACPI_REGISTER_PM1_STATUS, | ||
619 | &read_value); | 605 | &read_value); |
620 | if (ACPI_FAILURE(status)) { | 606 | if (ACPI_FAILURE(status)) { |
621 | goto unlock_and_exit; | 607 | goto exit; |
622 | } | 608 | } |
623 | 609 | ||
624 | /* Insert the bits to be preserved */ | 610 | /* Insert the bits to be preserved */ |
@@ -632,7 +618,7 @@ acpi_status acpi_hw_register_write(u8 use_lock, u32 register_id, u32 value) | |||
632 | acpi_hw_low_level_write(16, value, | 618 | acpi_hw_low_level_write(16, value, |
633 | &acpi_gbl_FADT.xpm1a_event_block); | 619 | &acpi_gbl_FADT.xpm1a_event_block); |
634 | if (ACPI_FAILURE(status)) { | 620 | if (ACPI_FAILURE(status)) { |
635 | goto unlock_and_exit; | 621 | goto exit; |
636 | } | 622 | } |
637 | 623 | ||
638 | /* PM1B is optional */ | 624 | /* PM1B is optional */ |
@@ -647,7 +633,7 @@ acpi_status acpi_hw_register_write(u8 use_lock, u32 register_id, u32 value) | |||
647 | status = | 633 | status = |
648 | acpi_hw_low_level_write(16, value, &acpi_gbl_xpm1a_enable); | 634 | acpi_hw_low_level_write(16, value, &acpi_gbl_xpm1a_enable); |
649 | if (ACPI_FAILURE(status)) { | 635 | if (ACPI_FAILURE(status)) { |
650 | goto unlock_and_exit; | 636 | goto exit; |
651 | } | 637 | } |
652 | 638 | ||
653 | /* PM1B is optional */ | 639 | /* PM1B is optional */ |
@@ -661,11 +647,10 @@ acpi_status acpi_hw_register_write(u8 use_lock, u32 register_id, u32 value) | |||
661 | /* | 647 | /* |
662 | * Perform a read first to preserve certain bits (per ACPI spec) | 648 | * Perform a read first to preserve certain bits (per ACPI spec) |
663 | */ | 649 | */ |
664 | status = acpi_hw_register_read(ACPI_MTX_DO_NOT_LOCK, | 650 | status = acpi_hw_register_read(ACPI_REGISTER_PM1_CONTROL, |
665 | ACPI_REGISTER_PM1_CONTROL, | ||
666 | &read_value); | 651 | &read_value); |
667 | if (ACPI_FAILURE(status)) { | 652 | if (ACPI_FAILURE(status)) { |
668 | goto unlock_and_exit; | 653 | goto exit; |
669 | } | 654 | } |
670 | 655 | ||
671 | /* Insert the bits to be preserved */ | 656 | /* Insert the bits to be preserved */ |
@@ -679,7 +664,7 @@ acpi_status acpi_hw_register_write(u8 use_lock, u32 register_id, u32 value) | |||
679 | acpi_hw_low_level_write(16, value, | 664 | acpi_hw_low_level_write(16, value, |
680 | &acpi_gbl_FADT.xpm1a_control_block); | 665 | &acpi_gbl_FADT.xpm1a_control_block); |
681 | if (ACPI_FAILURE(status)) { | 666 | if (ACPI_FAILURE(status)) { |
682 | goto unlock_and_exit; | 667 | goto exit; |
683 | } | 668 | } |
684 | 669 | ||
685 | status = | 670 | status = |
@@ -728,11 +713,7 @@ acpi_status acpi_hw_register_write(u8 use_lock, u32 register_id, u32 value) | |||
728 | break; | 713 | break; |
729 | } | 714 | } |
730 | 715 | ||
731 | unlock_and_exit: | 716 | exit: |
732 | if (ACPI_MTX_LOCK == use_lock) { | ||
733 | acpi_os_release_lock(acpi_gbl_hardware_lock, lock_flags); | ||
734 | } | ||
735 | |||
736 | return_ACPI_STATUS(status); | 717 | return_ACPI_STATUS(status); |
737 | } | 718 | } |
738 | 719 | ||
diff --git a/drivers/acpi/hardware/hwsleep.c b/drivers/acpi/hardware/hwsleep.c index cf69c0040a39..4d0c677fac19 100644 --- a/drivers/acpi/hardware/hwsleep.c +++ b/drivers/acpi/hardware/hwsleep.c | |||
@@ -313,8 +313,7 @@ acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state) | |||
313 | 313 | ||
314 | /* Get current value of PM1A control */ | 314 | /* Get current value of PM1A control */ |
315 | 315 | ||
316 | status = acpi_hw_register_read(ACPI_MTX_DO_NOT_LOCK, | 316 | status = acpi_hw_register_read(ACPI_REGISTER_PM1_CONTROL, &PM1Acontrol); |
317 | ACPI_REGISTER_PM1_CONTROL, &PM1Acontrol); | ||
318 | if (ACPI_FAILURE(status)) { | 317 | if (ACPI_FAILURE(status)) { |
319 | return_ACPI_STATUS(status); | 318 | return_ACPI_STATUS(status); |
320 | } | 319 | } |
@@ -341,15 +340,13 @@ acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state) | |||
341 | 340 | ||
342 | /* Write #1: fill in SLP_TYP data */ | 341 | /* Write #1: fill in SLP_TYP data */ |
343 | 342 | ||
344 | status = acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK, | 343 | status = acpi_hw_register_write(ACPI_REGISTER_PM1A_CONTROL, |
345 | ACPI_REGISTER_PM1A_CONTROL, | ||
346 | PM1Acontrol); | 344 | PM1Acontrol); |
347 | if (ACPI_FAILURE(status)) { | 345 | if (ACPI_FAILURE(status)) { |
348 | return_ACPI_STATUS(status); | 346 | return_ACPI_STATUS(status); |
349 | } | 347 | } |
350 | 348 | ||
351 | status = acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK, | 349 | status = acpi_hw_register_write(ACPI_REGISTER_PM1B_CONTROL, |
352 | ACPI_REGISTER_PM1B_CONTROL, | ||
353 | PM1Bcontrol); | 350 | PM1Bcontrol); |
354 | if (ACPI_FAILURE(status)) { | 351 | if (ACPI_FAILURE(status)) { |
355 | return_ACPI_STATUS(status); | 352 | return_ACPI_STATUS(status); |
@@ -364,15 +361,13 @@ acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state) | |||
364 | 361 | ||
365 | ACPI_FLUSH_CPU_CACHE(); | 362 | ACPI_FLUSH_CPU_CACHE(); |
366 | 363 | ||
367 | status = acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK, | 364 | status = acpi_hw_register_write(ACPI_REGISTER_PM1A_CONTROL, |
368 | ACPI_REGISTER_PM1A_CONTROL, | ||
369 | PM1Acontrol); | 365 | PM1Acontrol); |
370 | if (ACPI_FAILURE(status)) { | 366 | if (ACPI_FAILURE(status)) { |
371 | return_ACPI_STATUS(status); | 367 | return_ACPI_STATUS(status); |
372 | } | 368 | } |
373 | 369 | ||
374 | status = acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK, | 370 | status = acpi_hw_register_write(ACPI_REGISTER_PM1B_CONTROL, |
375 | ACPI_REGISTER_PM1B_CONTROL, | ||
376 | PM1Bcontrol); | 371 | PM1Bcontrol); |
377 | if (ACPI_FAILURE(status)) { | 372 | if (ACPI_FAILURE(status)) { |
378 | return_ACPI_STATUS(status); | 373 | return_ACPI_STATUS(status); |
@@ -392,8 +387,7 @@ acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state) | |||
392 | */ | 387 | */ |
393 | acpi_os_stall(10000000); | 388 | acpi_os_stall(10000000); |
394 | 389 | ||
395 | status = acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK, | 390 | status = acpi_hw_register_write(ACPI_REGISTER_PM1_CONTROL, |
396 | ACPI_REGISTER_PM1_CONTROL, | ||
397 | sleep_enable_reg_info-> | 391 | sleep_enable_reg_info-> |
398 | access_bit_mask); | 392 | access_bit_mask); |
399 | if (ACPI_FAILURE(status)) { | 393 | if (ACPI_FAILURE(status)) { |
@@ -520,8 +514,7 @@ acpi_status acpi_leave_sleep_state(u8 sleep_state) | |||
520 | 514 | ||
521 | /* Get current value of PM1A control */ | 515 | /* Get current value of PM1A control */ |
522 | 516 | ||
523 | status = acpi_hw_register_read(ACPI_MTX_DO_NOT_LOCK, | 517 | status = acpi_hw_register_read(ACPI_REGISTER_PM1_CONTROL, |
524 | ACPI_REGISTER_PM1_CONTROL, | ||
525 | &PM1Acontrol); | 518 | &PM1Acontrol); |
526 | if (ACPI_SUCCESS(status)) { | 519 | if (ACPI_SUCCESS(status)) { |
527 | 520 | ||
@@ -543,11 +536,9 @@ acpi_status acpi_leave_sleep_state(u8 sleep_state) | |||
543 | 536 | ||
544 | /* Just ignore any errors */ | 537 | /* Just ignore any errors */ |
545 | 538 | ||
546 | (void)acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK, | 539 | (void)acpi_hw_register_write(ACPI_REGISTER_PM1A_CONTROL, |
547 | ACPI_REGISTER_PM1A_CONTROL, | ||
548 | PM1Acontrol); | 540 | PM1Acontrol); |
549 | (void)acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK, | 541 | (void)acpi_hw_register_write(ACPI_REGISTER_PM1B_CONTROL, |
550 | ACPI_REGISTER_PM1B_CONTROL, | ||
551 | PM1Bcontrol); | 542 | PM1Bcontrol); |
552 | } | 543 | } |
553 | } | 544 | } |
diff --git a/include/acpi/achware.h b/include/acpi/achware.h index 9df275cf7bc1..4053df943453 100644 --- a/include/acpi/achware.h +++ b/include/acpi/achware.h | |||
@@ -71,9 +71,9 @@ u32 acpi_hw_get_mode(void); | |||
71 | struct acpi_bit_register_info *acpi_hw_get_bit_register_info(u32 register_id); | 71 | struct acpi_bit_register_info *acpi_hw_get_bit_register_info(u32 register_id); |
72 | 72 | ||
73 | acpi_status | 73 | acpi_status |
74 | acpi_hw_register_read(u8 use_lock, u32 register_id, u32 * return_value); | 74 | acpi_hw_register_read(u32 register_id, u32 * return_value); |
75 | 75 | ||
76 | acpi_status acpi_hw_register_write(u8 use_lock, u32 register_id, u32 value); | 76 | acpi_status acpi_hw_register_write(u32 register_id, u32 value); |
77 | 77 | ||
78 | acpi_status | 78 | acpi_status |
79 | acpi_hw_low_level_read(u32 width, | 79 | acpi_hw_low_level_read(u32 width, |