diff options
Diffstat (limited to 'drivers/acpi/hardware/hwregs.c')
-rw-r--r-- | drivers/acpi/hardware/hwregs.c | 64 |
1 files changed, 33 insertions, 31 deletions
diff --git a/drivers/acpi/hardware/hwregs.c b/drivers/acpi/hardware/hwregs.c index fa58c1edce1e..9fe7adf21f8b 100644 --- a/drivers/acpi/hardware/hwregs.c +++ b/drivers/acpi/hardware/hwregs.c | |||
@@ -73,7 +73,7 @@ acpi_status acpi_hw_clear_acpi_status(u32 flags) | |||
73 | 73 | ||
74 | ACPI_DEBUG_PRINT((ACPI_DB_IO, "About to write %04X to %04X\n", | 74 | ACPI_DEBUG_PRINT((ACPI_DB_IO, "About to write %04X to %04X\n", |
75 | ACPI_BITMASK_ALL_FIXED_STATUS, | 75 | ACPI_BITMASK_ALL_FIXED_STATUS, |
76 | (u16) acpi_gbl_FADT->xpm1a_evt_blk.address)); | 76 | (u16) acpi_gbl_FADT.xpm1a_event_block.address)); |
77 | 77 | ||
78 | lock_flags = acpi_os_acquire_lock(acpi_gbl_hardware_lock); | 78 | lock_flags = acpi_os_acquire_lock(acpi_gbl_hardware_lock); |
79 | 79 | ||
@@ -86,10 +86,10 @@ acpi_status acpi_hw_clear_acpi_status(u32 flags) | |||
86 | 86 | ||
87 | /* Clear the fixed events */ | 87 | /* Clear the fixed events */ |
88 | 88 | ||
89 | if (acpi_gbl_FADT->xpm1b_evt_blk.address) { | 89 | if (acpi_gbl_FADT.xpm1b_event_block.address) { |
90 | status = | 90 | status = |
91 | acpi_hw_low_level_write(16, ACPI_BITMASK_ALL_FIXED_STATUS, | 91 | acpi_hw_low_level_write(16, ACPI_BITMASK_ALL_FIXED_STATUS, |
92 | &acpi_gbl_FADT->xpm1b_evt_blk); | 92 | &acpi_gbl_FADT.xpm1b_event_block); |
93 | if (ACPI_FAILURE(status)) { | 93 | if (ACPI_FAILURE(status)) { |
94 | goto unlock_and_exit; | 94 | goto unlock_and_exit; |
95 | } | 95 | } |
@@ -422,8 +422,9 @@ acpi_status acpi_set_register(u32 register_id, u32 value, u32 flags) | |||
422 | ACPI_DEBUG_PRINT((ACPI_DB_IO, | 422 | ACPI_DEBUG_PRINT((ACPI_DB_IO, |
423 | "PM2 control: Read %X from %8.8X%8.8X\n", | 423 | "PM2 control: Read %X from %8.8X%8.8X\n", |
424 | register_value, | 424 | register_value, |
425 | ACPI_FORMAT_UINT64(acpi_gbl_FADT-> | 425 | ACPI_FORMAT_UINT64(acpi_gbl_FADT. |
426 | xpm2_cnt_blk.address))); | 426 | xpm2_control_block. |
427 | address))); | ||
427 | 428 | ||
428 | ACPI_REGISTER_INSERT_VALUE(register_value, | 429 | ACPI_REGISTER_INSERT_VALUE(register_value, |
429 | bit_reg_info->bit_position, | 430 | bit_reg_info->bit_position, |
@@ -433,8 +434,9 @@ acpi_status acpi_set_register(u32 register_id, u32 value, u32 flags) | |||
433 | ACPI_DEBUG_PRINT((ACPI_DB_IO, | 434 | ACPI_DEBUG_PRINT((ACPI_DB_IO, |
434 | "About to write %4.4X to %8.8X%8.8X\n", | 435 | "About to write %4.4X to %8.8X%8.8X\n", |
435 | register_value, | 436 | register_value, |
436 | ACPI_FORMAT_UINT64(acpi_gbl_FADT-> | 437 | ACPI_FORMAT_UINT64(acpi_gbl_FADT. |
437 | xpm2_cnt_blk.address))); | 438 | xpm2_control_block. |
439 | address))); | ||
438 | 440 | ||
439 | status = acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK, | 441 | status = acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK, |
440 | ACPI_REGISTER_PM2_CONTROL, | 442 | ACPI_REGISTER_PM2_CONTROL, |
@@ -495,7 +497,7 @@ acpi_hw_register_read(u8 use_lock, u32 register_id, u32 * return_value) | |||
495 | 497 | ||
496 | status = | 498 | status = |
497 | acpi_hw_low_level_read(16, &value1, | 499 | acpi_hw_low_level_read(16, &value1, |
498 | &acpi_gbl_FADT->xpm1a_evt_blk); | 500 | &acpi_gbl_FADT.xpm1a_event_block); |
499 | if (ACPI_FAILURE(status)) { | 501 | if (ACPI_FAILURE(status)) { |
500 | goto unlock_and_exit; | 502 | goto unlock_and_exit; |
501 | } | 503 | } |
@@ -504,7 +506,7 @@ acpi_hw_register_read(u8 use_lock, u32 register_id, u32 * return_value) | |||
504 | 506 | ||
505 | status = | 507 | status = |
506 | acpi_hw_low_level_read(16, &value2, | 508 | acpi_hw_low_level_read(16, &value2, |
507 | &acpi_gbl_FADT->xpm1b_evt_blk); | 509 | &acpi_gbl_FADT.xpm1b_event_block); |
508 | value1 |= value2; | 510 | value1 |= value2; |
509 | break; | 511 | break; |
510 | 512 | ||
@@ -527,14 +529,14 @@ acpi_hw_register_read(u8 use_lock, u32 register_id, u32 * return_value) | |||
527 | 529 | ||
528 | status = | 530 | status = |
529 | acpi_hw_low_level_read(16, &value1, | 531 | acpi_hw_low_level_read(16, &value1, |
530 | &acpi_gbl_FADT->xpm1a_cnt_blk); | 532 | &acpi_gbl_FADT.xpm1a_control_block); |
531 | if (ACPI_FAILURE(status)) { | 533 | if (ACPI_FAILURE(status)) { |
532 | goto unlock_and_exit; | 534 | goto unlock_and_exit; |
533 | } | 535 | } |
534 | 536 | ||
535 | status = | 537 | status = |
536 | acpi_hw_low_level_read(16, &value2, | 538 | acpi_hw_low_level_read(16, &value2, |
537 | &acpi_gbl_FADT->xpm1b_cnt_blk); | 539 | &acpi_gbl_FADT.xpm1b_control_block); |
538 | value1 |= value2; | 540 | value1 |= value2; |
539 | break; | 541 | break; |
540 | 542 | ||
@@ -542,19 +544,20 @@ acpi_hw_register_read(u8 use_lock, u32 register_id, u32 * return_value) | |||
542 | 544 | ||
543 | status = | 545 | status = |
544 | acpi_hw_low_level_read(8, &value1, | 546 | acpi_hw_low_level_read(8, &value1, |
545 | &acpi_gbl_FADT->xpm2_cnt_blk); | 547 | &acpi_gbl_FADT.xpm2_control_block); |
546 | break; | 548 | break; |
547 | 549 | ||
548 | case ACPI_REGISTER_PM_TIMER: /* 32-bit access */ | 550 | case ACPI_REGISTER_PM_TIMER: /* 32-bit access */ |
549 | 551 | ||
550 | status = | 552 | status = |
551 | acpi_hw_low_level_read(32, &value1, | 553 | acpi_hw_low_level_read(32, &value1, |
552 | &acpi_gbl_FADT->xpm_tmr_blk); | 554 | &acpi_gbl_FADT.xpm_timer_block); |
553 | break; | 555 | break; |
554 | 556 | ||
555 | case ACPI_REGISTER_SMI_COMMAND_BLOCK: /* 8-bit access */ | 557 | case ACPI_REGISTER_SMI_COMMAND_BLOCK: /* 8-bit access */ |
556 | 558 | ||
557 | status = acpi_os_read_port(acpi_gbl_FADT->smi_cmd, &value1, 8); | 559 | status = |
560 | acpi_os_read_port(acpi_gbl_FADT.smi_command, &value1, 8); | ||
558 | break; | 561 | break; |
559 | 562 | ||
560 | default: | 563 | default: |
@@ -635,7 +638,7 @@ acpi_status acpi_hw_register_write(u8 use_lock, u32 register_id, u32 value) | |||
635 | 638 | ||
636 | status = | 639 | status = |
637 | acpi_hw_low_level_write(16, value, | 640 | acpi_hw_low_level_write(16, value, |
638 | &acpi_gbl_FADT->xpm1a_evt_blk); | 641 | &acpi_gbl_FADT.xpm1a_event_block); |
639 | if (ACPI_FAILURE(status)) { | 642 | if (ACPI_FAILURE(status)) { |
640 | goto unlock_and_exit; | 643 | goto unlock_and_exit; |
641 | } | 644 | } |
@@ -644,7 +647,7 @@ acpi_status acpi_hw_register_write(u8 use_lock, u32 register_id, u32 value) | |||
644 | 647 | ||
645 | status = | 648 | status = |
646 | acpi_hw_low_level_write(16, value, | 649 | acpi_hw_low_level_write(16, value, |
647 | &acpi_gbl_FADT->xpm1b_evt_blk); | 650 | &acpi_gbl_FADT.xpm1b_event_block); |
648 | break; | 651 | break; |
649 | 652 | ||
650 | case ACPI_REGISTER_PM1_ENABLE: /* 16-bit access */ | 653 | case ACPI_REGISTER_PM1_ENABLE: /* 16-bit access */ |
@@ -682,49 +685,50 @@ acpi_status acpi_hw_register_write(u8 use_lock, u32 register_id, u32 value) | |||
682 | 685 | ||
683 | status = | 686 | status = |
684 | acpi_hw_low_level_write(16, value, | 687 | acpi_hw_low_level_write(16, value, |
685 | &acpi_gbl_FADT->xpm1a_cnt_blk); | 688 | &acpi_gbl_FADT.xpm1a_control_block); |
686 | if (ACPI_FAILURE(status)) { | 689 | if (ACPI_FAILURE(status)) { |
687 | goto unlock_and_exit; | 690 | goto unlock_and_exit; |
688 | } | 691 | } |
689 | 692 | ||
690 | status = | 693 | status = |
691 | acpi_hw_low_level_write(16, value, | 694 | acpi_hw_low_level_write(16, value, |
692 | &acpi_gbl_FADT->xpm1b_cnt_blk); | 695 | &acpi_gbl_FADT.xpm1b_control_block); |
693 | break; | 696 | break; |
694 | 697 | ||
695 | case ACPI_REGISTER_PM1A_CONTROL: /* 16-bit access */ | 698 | case ACPI_REGISTER_PM1A_CONTROL: /* 16-bit access */ |
696 | 699 | ||
697 | status = | 700 | status = |
698 | acpi_hw_low_level_write(16, value, | 701 | acpi_hw_low_level_write(16, value, |
699 | &acpi_gbl_FADT->xpm1a_cnt_blk); | 702 | &acpi_gbl_FADT.xpm1a_control_block); |
700 | break; | 703 | break; |
701 | 704 | ||
702 | case ACPI_REGISTER_PM1B_CONTROL: /* 16-bit access */ | 705 | case ACPI_REGISTER_PM1B_CONTROL: /* 16-bit access */ |
703 | 706 | ||
704 | status = | 707 | status = |
705 | acpi_hw_low_level_write(16, value, | 708 | acpi_hw_low_level_write(16, value, |
706 | &acpi_gbl_FADT->xpm1b_cnt_blk); | 709 | &acpi_gbl_FADT.xpm1b_control_block); |
707 | break; | 710 | break; |
708 | 711 | ||
709 | case ACPI_REGISTER_PM2_CONTROL: /* 8-bit access */ | 712 | case ACPI_REGISTER_PM2_CONTROL: /* 8-bit access */ |
710 | 713 | ||
711 | status = | 714 | status = |
712 | acpi_hw_low_level_write(8, value, | 715 | acpi_hw_low_level_write(8, value, |
713 | &acpi_gbl_FADT->xpm2_cnt_blk); | 716 | &acpi_gbl_FADT.xpm2_control_block); |
714 | break; | 717 | break; |
715 | 718 | ||
716 | case ACPI_REGISTER_PM_TIMER: /* 32-bit access */ | 719 | case ACPI_REGISTER_PM_TIMER: /* 32-bit access */ |
717 | 720 | ||
718 | status = | 721 | status = |
719 | acpi_hw_low_level_write(32, value, | 722 | acpi_hw_low_level_write(32, value, |
720 | &acpi_gbl_FADT->xpm_tmr_blk); | 723 | &acpi_gbl_FADT.xpm_timer_block); |
721 | break; | 724 | break; |
722 | 725 | ||
723 | case ACPI_REGISTER_SMI_COMMAND_BLOCK: /* 8-bit access */ | 726 | case ACPI_REGISTER_SMI_COMMAND_BLOCK: /* 8-bit access */ |
724 | 727 | ||
725 | /* SMI_CMD is currently always in IO space */ | 728 | /* SMI_CMD is currently always in IO space */ |
726 | 729 | ||
727 | status = acpi_os_write_port(acpi_gbl_FADT->smi_cmd, value, 8); | 730 | status = |
731 | acpi_os_write_port(acpi_gbl_FADT.smi_command, value, 8); | ||
728 | break; | 732 | break; |
729 | 733 | ||
730 | default: | 734 | default: |
@@ -783,7 +787,7 @@ acpi_hw_low_level_read(u32 width, u32 * value, struct acpi_generic_address *reg) | |||
783 | * Two address spaces supported: Memory or IO. | 787 | * Two address spaces supported: Memory or IO. |
784 | * PCI_Config is not supported here because the GAS struct is insufficient | 788 | * PCI_Config is not supported here because the GAS struct is insufficient |
785 | */ | 789 | */ |
786 | switch (reg->address_space_id) { | 790 | switch (reg->space_id) { |
787 | case ACPI_ADR_SPACE_SYSTEM_MEMORY: | 791 | case ACPI_ADR_SPACE_SYSTEM_MEMORY: |
788 | 792 | ||
789 | status = acpi_os_read_memory((acpi_physical_address) address, | 793 | status = acpi_os_read_memory((acpi_physical_address) address, |
@@ -798,8 +802,7 @@ acpi_hw_low_level_read(u32 width, u32 * value, struct acpi_generic_address *reg) | |||
798 | 802 | ||
799 | default: | 803 | default: |
800 | ACPI_ERROR((AE_INFO, | 804 | ACPI_ERROR((AE_INFO, |
801 | "Unsupported address space: %X", | 805 | "Unsupported address space: %X", reg->space_id)); |
802 | reg->address_space_id)); | ||
803 | return (AE_BAD_PARAMETER); | 806 | return (AE_BAD_PARAMETER); |
804 | } | 807 | } |
805 | 808 | ||
@@ -807,7 +810,7 @@ acpi_hw_low_level_read(u32 width, u32 * value, struct acpi_generic_address *reg) | |||
807 | "Read: %8.8X width %2d from %8.8X%8.8X (%s)\n", | 810 | "Read: %8.8X width %2d from %8.8X%8.8X (%s)\n", |
808 | *value, width, | 811 | *value, width, |
809 | ACPI_FORMAT_UINT64(address), | 812 | ACPI_FORMAT_UINT64(address), |
810 | acpi_ut_get_region_name(reg->address_space_id))); | 813 | acpi_ut_get_region_name(reg->space_id))); |
811 | 814 | ||
812 | return (status); | 815 | return (status); |
813 | } | 816 | } |
@@ -854,7 +857,7 @@ acpi_hw_low_level_write(u32 width, u32 value, struct acpi_generic_address * reg) | |||
854 | * Two address spaces supported: Memory or IO. | 857 | * Two address spaces supported: Memory or IO. |
855 | * PCI_Config is not supported here because the GAS struct is insufficient | 858 | * PCI_Config is not supported here because the GAS struct is insufficient |
856 | */ | 859 | */ |
857 | switch (reg->address_space_id) { | 860 | switch (reg->space_id) { |
858 | case ACPI_ADR_SPACE_SYSTEM_MEMORY: | 861 | case ACPI_ADR_SPACE_SYSTEM_MEMORY: |
859 | 862 | ||
860 | status = acpi_os_write_memory((acpi_physical_address) address, | 863 | status = acpi_os_write_memory((acpi_physical_address) address, |
@@ -869,8 +872,7 @@ acpi_hw_low_level_write(u32 width, u32 value, struct acpi_generic_address * reg) | |||
869 | 872 | ||
870 | default: | 873 | default: |
871 | ACPI_ERROR((AE_INFO, | 874 | ACPI_ERROR((AE_INFO, |
872 | "Unsupported address space: %X", | 875 | "Unsupported address space: %X", reg->space_id)); |
873 | reg->address_space_id)); | ||
874 | return (AE_BAD_PARAMETER); | 876 | return (AE_BAD_PARAMETER); |
875 | } | 877 | } |
876 | 878 | ||
@@ -878,7 +880,7 @@ acpi_hw_low_level_write(u32 width, u32 value, struct acpi_generic_address * reg) | |||
878 | "Wrote: %8.8X width %2d to %8.8X%8.8X (%s)\n", | 880 | "Wrote: %8.8X width %2d to %8.8X%8.8X (%s)\n", |
879 | value, width, | 881 | value, width, |
880 | ACPI_FORMAT_UINT64(address), | 882 | ACPI_FORMAT_UINT64(address), |
881 | acpi_ut_get_region_name(reg->address_space_id))); | 883 | acpi_ut_get_region_name(reg->space_id))); |
882 | 884 | ||
883 | return (status); | 885 | return (status); |
884 | } | 886 | } |