aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2008-12-30 13:55:32 -0500
committerLen Brown <len.brown@intel.com>2008-12-31 01:12:56 -0500
commitecfbbc7b46f74ca48b9f42132739114c9e70f8e4 (patch)
tree99ff958735f35d812cf25075cc19d4c0f5c0ecb1
parent385c4d98d851bc94ad4f351fe25fe49b70b9cf78 (diff)
ACPICA: New: acpi_read and acpi_write public interfaces
Changed the acpi_hw_low_level_read and acpi_hw_low_level_write functions to the public acpi_read and acpi_write to allow direct access to ACPI registers. Removed the "width" parameter since the width can be obtained from the input GAS structure. Updated the FADT initialization to setup the GAS structures with the proper widths. Some widths are still hardcoded because many FADTs have incorrect register lengths. Signed-off-by: Bob Moore <robert.moore@intel.com Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
-rw-r--r--drivers/acpi/events/evgpe.c12
-rw-r--r--drivers/acpi/events/evgpeblk.c14
-rw-r--r--drivers/acpi/hardware/hwgpe.c49
-rw-r--r--drivers/acpi/hardware/hwregs.c117
-rw-r--r--drivers/acpi/reboot.c2
-rw-r--r--include/acpi/achware.h7
-rw-r--r--include/acpi/acpixf.h14
7 files changed, 89 insertions, 126 deletions
diff --git a/drivers/acpi/events/evgpe.c b/drivers/acpi/events/evgpe.c
index 12b49d312ad3..a54885993ed3 100644
--- a/drivers/acpi/events/evgpe.c
+++ b/drivers/acpi/events/evgpe.c
@@ -422,10 +422,8 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list)
422 /* Read the Status Register */ 422 /* Read the Status Register */
423 423
424 status = 424 status =
425 acpi_hw_low_level_read(ACPI_GPE_REGISTER_WIDTH, 425 acpi_read(&status_reg,
426 &status_reg, 426 &gpe_register_info->status_address);
427 &gpe_register_info->
428 status_address);
429 if (ACPI_FAILURE(status)) { 427 if (ACPI_FAILURE(status)) {
430 goto unlock_and_exit; 428 goto unlock_and_exit;
431 } 429 }
@@ -433,10 +431,8 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list)
433 /* Read the Enable Register */ 431 /* Read the Enable Register */
434 432
435 status = 433 status =
436 acpi_hw_low_level_read(ACPI_GPE_REGISTER_WIDTH, 434 acpi_read(&enable_reg,
437 &enable_reg, 435 &gpe_register_info->enable_address);
438 &gpe_register_info->
439 enable_address);
440 if (ACPI_FAILURE(status)) { 436 if (ACPI_FAILURE(status)) {
441 goto unlock_and_exit; 437 goto unlock_and_exit;
442 } 438 }
diff --git a/drivers/acpi/events/evgpeblk.c b/drivers/acpi/events/evgpeblk.c
index 2872be2b9be5..488503ffcd3e 100644
--- a/drivers/acpi/events/evgpeblk.c
+++ b/drivers/acpi/events/evgpeblk.c
@@ -830,10 +830,8 @@ acpi_ev_create_gpe_info_blocks(struct acpi_gpe_block_info *gpe_block)
830 ACPI_GPE_REGISTER_WIDTH; 830 ACPI_GPE_REGISTER_WIDTH;
831 this_register->enable_address.bit_width = 831 this_register->enable_address.bit_width =
832 ACPI_GPE_REGISTER_WIDTH; 832 ACPI_GPE_REGISTER_WIDTH;
833 this_register->status_address.bit_offset = 833 this_register->status_address.bit_offset = 0;
834 ACPI_GPE_REGISTER_WIDTH; 834 this_register->enable_address.bit_offset = 0;
835 this_register->enable_address.bit_offset =
836 ACPI_GPE_REGISTER_WIDTH;
837 835
838 /* Init the event_info for each GPE within this register */ 836 /* Init the event_info for each GPE within this register */
839 837
@@ -846,18 +844,14 @@ acpi_ev_create_gpe_info_blocks(struct acpi_gpe_block_info *gpe_block)
846 844
847 /* Disable all GPEs within this register */ 845 /* Disable all GPEs within this register */
848 846
849 status = acpi_hw_low_level_write(ACPI_GPE_REGISTER_WIDTH, 0x00, 847 status = acpi_write(0x00, &this_register->enable_address);
850 &this_register->
851 enable_address);
852 if (ACPI_FAILURE(status)) { 848 if (ACPI_FAILURE(status)) {
853 goto error_exit; 849 goto error_exit;
854 } 850 }
855 851
856 /* Clear any pending GPE events within this register */ 852 /* Clear any pending GPE events within this register */
857 853
858 status = acpi_hw_low_level_write(ACPI_GPE_REGISTER_WIDTH, 0xFF, 854 status = acpi_write(0xFF, &this_register->status_address);
859 &this_register->
860 status_address);
861 if (ACPI_FAILURE(status)) { 855 if (ACPI_FAILURE(status)) {
862 goto error_exit; 856 goto error_exit;
863 } 857 }
diff --git a/drivers/acpi/hardware/hwgpe.c b/drivers/acpi/hardware/hwgpe.c
index 5ab7cac6fbb9..09aaeaac3d0b 100644
--- a/drivers/acpi/hardware/hwgpe.c
+++ b/drivers/acpi/hardware/hwgpe.c
@@ -81,8 +81,7 @@ acpi_status acpi_hw_low_disable_gpe(struct acpi_gpe_event_info *gpe_event_info)
81 81
82 /* Get current value of the enable register that contains this GPE */ 82 /* Get current value of the enable register that contains this GPE */
83 83
84 status = acpi_hw_low_level_read(ACPI_GPE_REGISTER_WIDTH, &enable_mask, 84 status = acpi_read(&enable_mask, &gpe_register_info->enable_address);
85 &gpe_register_info->enable_address);
86 if (ACPI_FAILURE(status)) { 85 if (ACPI_FAILURE(status)) {
87 return (status); 86 return (status);
88 } 87 }
@@ -96,9 +95,7 @@ acpi_status acpi_hw_low_disable_gpe(struct acpi_gpe_event_info *gpe_event_info)
96 95
97 /* Write the updated enable mask */ 96 /* Write the updated enable mask */
98 97
99 status = acpi_hw_low_level_write(ACPI_GPE_REGISTER_WIDTH, enable_mask, 98 status = acpi_write(enable_mask, &gpe_register_info->enable_address);
100 &gpe_register_info->enable_address);
101
102 return (status); 99 return (status);
103} 100}
104 101
@@ -133,8 +130,8 @@ acpi_hw_write_gpe_enable_reg(struct acpi_gpe_event_info * gpe_event_info)
133 130
134 /* Write the entire GPE (runtime) enable register */ 131 /* Write the entire GPE (runtime) enable register */
135 132
136 status = acpi_hw_low_level_write(8, gpe_register_info->enable_for_run, 133 status = acpi_write(gpe_register_info->enable_for_run,
137 &gpe_register_info->enable_address); 134 &gpe_register_info->enable_address);
138 135
139 return (status); 136 return (status);
140} 137}
@@ -167,9 +164,8 @@ acpi_status acpi_hw_clear_gpe(struct acpi_gpe_event_info * gpe_event_info)
167 * Write a one to the appropriate bit in the status register to 164 * Write a one to the appropriate bit in the status register to
168 * clear this GPE. 165 * clear this GPE.
169 */ 166 */
170 status = acpi_hw_low_level_write(8, register_bit, 167 status = acpi_write(register_bit,
171 &gpe_event_info->register_info-> 168 &gpe_event_info->register_info->status_address);
172 status_address);
173 169
174 return (status); 170 return (status);
175} 171}
@@ -228,9 +224,7 @@ acpi_hw_get_gpe_status(struct acpi_gpe_event_info * gpe_event_info,
228 224
229 /* GPE currently active (status bit == 1)? */ 225 /* GPE currently active (status bit == 1)? */
230 226
231 status = 227 status = acpi_read(&in_byte, &gpe_register_info->status_address);
232 acpi_hw_low_level_read(8, &in_byte,
233 &gpe_register_info->status_address);
234 if (ACPI_FAILURE(status)) { 228 if (ACPI_FAILURE(status)) {
235 goto unlock_and_exit; 229 goto unlock_and_exit;
236 } 230 }
@@ -273,9 +267,9 @@ acpi_hw_disable_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
273 267
274 /* Disable all GPEs in this register */ 268 /* Disable all GPEs in this register */
275 269
276 status = acpi_hw_low_level_write(8, 0x00, 270 status =
277 &gpe_block->register_info[i]. 271 acpi_write(0x00,
278 enable_address); 272 &gpe_block->register_info[i].enable_address);
279 if (ACPI_FAILURE(status)) { 273 if (ACPI_FAILURE(status)) {
280 return (status); 274 return (status);
281 } 275 }
@@ -310,9 +304,9 @@ acpi_hw_clear_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
310 304
311 /* Clear status on all GPEs in this register */ 305 /* Clear status on all GPEs in this register */
312 306
313 status = acpi_hw_low_level_write(8, 0xFF, 307 status =
314 &gpe_block->register_info[i]. 308 acpi_write(0xFF,
315 status_address); 309 &gpe_block->register_info[i].status_address);
316 if (ACPI_FAILURE(status)) { 310 if (ACPI_FAILURE(status)) {
317 return (status); 311 return (status);
318 } 312 }
@@ -353,12 +347,9 @@ acpi_hw_enable_runtime_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
353 347
354 /* Enable all "runtime" GPEs in this register */ 348 /* Enable all "runtime" GPEs in this register */
355 349
356 status = 350 status = acpi_write(gpe_block->register_info[i].enable_for_run,
357 acpi_hw_low_level_write(8, 351 &gpe_block->register_info[i].
358 gpe_block->register_info[i]. 352 enable_address);
359 enable_for_run,
360 &gpe_block->register_info[i].
361 enable_address);
362 if (ACPI_FAILURE(status)) { 353 if (ACPI_FAILURE(status)) {
363 return (status); 354 return (status);
364 } 355 }
@@ -398,11 +389,9 @@ acpi_hw_enable_wakeup_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
398 389
399 /* Enable all "wake" GPEs in this register */ 390 /* Enable all "wake" GPEs in this register */
400 391
401 status = acpi_hw_low_level_write(8, 392 status = acpi_write(gpe_block->register_info[i].enable_for_wake,
402 gpe_block->register_info[i]. 393 &gpe_block->register_info[i].
403 enable_for_wake, 394 enable_address);
404 &gpe_block->register_info[i].
405 enable_address);
406 if (ACPI_FAILURE(status)) { 395 if (ACPI_FAILURE(status)) {
407 return (status); 396 return (status);
408 } 397 }
diff --git a/drivers/acpi/hardware/hwregs.c b/drivers/acpi/hardware/hwregs.c
index 69dc8b45d76c..d6d2ec6969f4 100644
--- a/drivers/acpi/hardware/hwregs.c
+++ b/drivers/acpi/hardware/hwregs.c
@@ -84,9 +84,8 @@ acpi_status acpi_hw_clear_acpi_status(void)
84 /* Clear the fixed events */ 84 /* Clear the fixed events */
85 85
86 if (acpi_gbl_FADT.xpm1b_event_block.address) { 86 if (acpi_gbl_FADT.xpm1b_event_block.address) {
87 status = 87 status = acpi_write(ACPI_BITMASK_ALL_FIXED_STATUS,
88 acpi_hw_low_level_write(16, ACPI_BITMASK_ALL_FIXED_STATUS, 88 &acpi_gbl_FADT.xpm1b_event_block);
89 &acpi_gbl_FADT.xpm1b_event_block);
90 if (ACPI_FAILURE(status)) { 89 if (ACPI_FAILURE(status)) {
91 goto unlock_and_exit; 90 goto unlock_and_exit;
92 } 91 }
@@ -244,6 +243,8 @@ struct acpi_bit_register_info *acpi_hw_get_bit_register_info(u32 register_id)
244 return (&acpi_gbl_bit_register_info[register_id]); 243 return (&acpi_gbl_bit_register_info[register_id]);
245} 244}
246 245
246ACPI_EXPORT_SYMBOL(acpi_get_register_unlocked)
247
247/******************************************************************************* 248/*******************************************************************************
248 * 249 *
249 * FUNCTION: acpi_get_register 250 * FUNCTION: acpi_get_register
@@ -483,63 +484,49 @@ acpi_hw_register_read(u32 register_id, u32 * return_value)
483 switch (register_id) { 484 switch (register_id) {
484 case ACPI_REGISTER_PM1_STATUS: /* 16-bit access */ 485 case ACPI_REGISTER_PM1_STATUS: /* 16-bit access */
485 486
486 status = 487 status = acpi_read(&value1, &acpi_gbl_FADT.xpm1a_event_block);
487 acpi_hw_low_level_read(16, &value1,
488 &acpi_gbl_FADT.xpm1a_event_block);
489 if (ACPI_FAILURE(status)) { 488 if (ACPI_FAILURE(status)) {
490 goto exit; 489 goto exit;
491 } 490 }
492 491
493 /* PM1B is optional */ 492 /* PM1B is optional */
494 493
495 status = 494 status = acpi_read(&value2, &acpi_gbl_FADT.xpm1b_event_block);
496 acpi_hw_low_level_read(16, &value2,
497 &acpi_gbl_FADT.xpm1b_event_block);
498 value1 |= value2; 495 value1 |= value2;
499 break; 496 break;
500 497
501 case ACPI_REGISTER_PM1_ENABLE: /* 16-bit access */ 498 case ACPI_REGISTER_PM1_ENABLE: /* 16-bit access */
502 499
503 status = 500 status = acpi_read(&value1, &acpi_gbl_xpm1a_enable);
504 acpi_hw_low_level_read(16, &value1, &acpi_gbl_xpm1a_enable);
505 if (ACPI_FAILURE(status)) { 501 if (ACPI_FAILURE(status)) {
506 goto exit; 502 goto exit;
507 } 503 }
508 504
509 /* PM1B is optional */ 505 /* PM1B is optional */
510 506
511 status = 507 status = acpi_read(&value2, &acpi_gbl_xpm1b_enable);
512 acpi_hw_low_level_read(16, &value2, &acpi_gbl_xpm1b_enable);
513 value1 |= value2; 508 value1 |= value2;
514 break; 509 break;
515 510
516 case ACPI_REGISTER_PM1_CONTROL: /* 16-bit access */ 511 case ACPI_REGISTER_PM1_CONTROL: /* 16-bit access */
517 512
518 status = 513 status = acpi_read(&value1, &acpi_gbl_FADT.xpm1a_control_block);
519 acpi_hw_low_level_read(16, &value1,
520 &acpi_gbl_FADT.xpm1a_control_block);
521 if (ACPI_FAILURE(status)) { 514 if (ACPI_FAILURE(status)) {
522 goto exit; 515 goto exit;
523 } 516 }
524 517
525 status = 518 status = acpi_read(&value2, &acpi_gbl_FADT.xpm1b_control_block);
526 acpi_hw_low_level_read(16, &value2,
527 &acpi_gbl_FADT.xpm1b_control_block);
528 value1 |= value2; 519 value1 |= value2;
529 break; 520 break;
530 521
531 case ACPI_REGISTER_PM2_CONTROL: /* 8-bit access */ 522 case ACPI_REGISTER_PM2_CONTROL: /* 8-bit access */
532 523
533 status = 524 status = acpi_read(&value1, &acpi_gbl_FADT.xpm2_control_block);
534 acpi_hw_low_level_read(8, &value1,
535 &acpi_gbl_FADT.xpm2_control_block);
536 break; 525 break;
537 526
538 case ACPI_REGISTER_PM_TIMER: /* 32-bit access */ 527 case ACPI_REGISTER_PM_TIMER: /* 32-bit access */
539 528
540 status = 529 status = acpi_read(&value1, &acpi_gbl_FADT.xpm_timer_block);
541 acpi_hw_low_level_read(32, &value1,
542 &acpi_gbl_FADT.xpm_timer_block);
543 break; 530 break;
544 531
545 case ACPI_REGISTER_SMI_COMMAND_BLOCK: /* 8-bit access */ 532 case ACPI_REGISTER_SMI_COMMAND_BLOCK: /* 8-bit access */
@@ -614,32 +601,26 @@ acpi_status acpi_hw_register_write(u32 register_id, u32 value)
614 601
615 /* Now we can write the data */ 602 /* Now we can write the data */
616 603
617 status = 604 status = acpi_write(value, &acpi_gbl_FADT.xpm1a_event_block);
618 acpi_hw_low_level_write(16, value,
619 &acpi_gbl_FADT.xpm1a_event_block);
620 if (ACPI_FAILURE(status)) { 605 if (ACPI_FAILURE(status)) {
621 goto exit; 606 goto exit;
622 } 607 }
623 608
624 /* PM1B is optional */ 609 /* PM1B is optional */
625 610
626 status = 611 status = acpi_write(value, &acpi_gbl_FADT.xpm1b_event_block);
627 acpi_hw_low_level_write(16, value,
628 &acpi_gbl_FADT.xpm1b_event_block);
629 break; 612 break;
630 613
631 case ACPI_REGISTER_PM1_ENABLE: /* 16-bit access */ 614 case ACPI_REGISTER_PM1_ENABLE: /* 16-bit access */
632 615
633 status = 616 status = acpi_write(value, &acpi_gbl_xpm1a_enable);
634 acpi_hw_low_level_write(16, value, &acpi_gbl_xpm1a_enable);
635 if (ACPI_FAILURE(status)) { 617 if (ACPI_FAILURE(status)) {
636 goto exit; 618 goto exit;
637 } 619 }
638 620
639 /* PM1B is optional */ 621 /* PM1B is optional */
640 622
641 status = 623 status = acpi_write(value, &acpi_gbl_xpm1b_enable);
642 acpi_hw_low_level_write(16, value, &acpi_gbl_xpm1b_enable);
643 break; 624 break;
644 625
645 case ACPI_REGISTER_PM1_CONTROL: /* 16-bit access */ 626 case ACPI_REGISTER_PM1_CONTROL: /* 16-bit access */
@@ -660,44 +641,32 @@ acpi_status acpi_hw_register_write(u32 register_id, u32 value)
660 641
661 /* Now we can write the data */ 642 /* Now we can write the data */
662 643
663 status = 644 status = acpi_write(value, &acpi_gbl_FADT.xpm1a_control_block);
664 acpi_hw_low_level_write(16, value,
665 &acpi_gbl_FADT.xpm1a_control_block);
666 if (ACPI_FAILURE(status)) { 645 if (ACPI_FAILURE(status)) {
667 goto exit; 646 goto exit;
668 } 647 }
669 648
670 status = 649 status = acpi_write(value, &acpi_gbl_FADT.xpm1b_control_block);
671 acpi_hw_low_level_write(16, value,
672 &acpi_gbl_FADT.xpm1b_control_block);
673 break; 650 break;
674 651
675 case ACPI_REGISTER_PM1A_CONTROL: /* 16-bit access */ 652 case ACPI_REGISTER_PM1A_CONTROL: /* 16-bit access */
676 653
677 status = 654 status = acpi_write(value, &acpi_gbl_FADT.xpm1a_control_block);
678 acpi_hw_low_level_write(16, value,
679 &acpi_gbl_FADT.xpm1a_control_block);
680 break; 655 break;
681 656
682 case ACPI_REGISTER_PM1B_CONTROL: /* 16-bit access */ 657 case ACPI_REGISTER_PM1B_CONTROL: /* 16-bit access */
683 658
684 status = 659 status = acpi_write(value, &acpi_gbl_FADT.xpm1b_control_block);
685 acpi_hw_low_level_write(16, value,
686 &acpi_gbl_FADT.xpm1b_control_block);
687 break; 660 break;
688 661
689 case ACPI_REGISTER_PM2_CONTROL: /* 8-bit access */ 662 case ACPI_REGISTER_PM2_CONTROL: /* 8-bit access */
690 663
691 status = 664 status = acpi_write(value, &acpi_gbl_FADT.xpm2_control_block);
692 acpi_hw_low_level_write(8, value,
693 &acpi_gbl_FADT.xpm2_control_block);
694 break; 665 break;
695 666
696 case ACPI_REGISTER_PM_TIMER: /* 32-bit access */ 667 case ACPI_REGISTER_PM_TIMER: /* 32-bit access */
697 668
698 status = 669 status = acpi_write(value, &acpi_gbl_FADT.xpm_timer_block);
699 acpi_hw_low_level_write(32, value,
700 &acpi_gbl_FADT.xpm_timer_block);
701 break; 670 break;
702 671
703 case ACPI_REGISTER_SMI_COMMAND_BLOCK: /* 8-bit access */ 672 case ACPI_REGISTER_SMI_COMMAND_BLOCK: /* 8-bit access */
@@ -719,10 +688,9 @@ acpi_status acpi_hw_register_write(u32 register_id, u32 value)
719 688
720/****************************************************************************** 689/******************************************************************************
721 * 690 *
722 * FUNCTION: acpi_hw_low_level_read 691 * FUNCTION: acpi_read
723 * 692 *
724 * PARAMETERS: Width - 8, 16, or 32 693 * PARAMETERS: Value - Where the value is returned
725 * Value - Where the value is returned
726 * Reg - GAS register structure 694 * Reg - GAS register structure
727 * 695 *
728 * RETURN: Status 696 * RETURN: Status
@@ -731,13 +699,13 @@ acpi_status acpi_hw_register_write(u32 register_id, u32 value)
731 * 699 *
732 ******************************************************************************/ 700 ******************************************************************************/
733 701
734acpi_status 702acpi_status acpi_read(u32 *value, struct acpi_generic_address *reg)
735acpi_hw_low_level_read(u32 width, u32 * value, struct acpi_generic_address *reg)
736{ 703{
704 u32 width;
737 u64 address; 705 u64 address;
738 acpi_status status; 706 acpi_status status;
739 707
740 ACPI_FUNCTION_NAME(hw_low_level_read); 708 ACPI_FUNCTION_NAME(acpi_read);
741 709
742 /* 710 /*
743 * Must have a valid pointer to a GAS structure, and 711 * Must have a valid pointer to a GAS structure, and
@@ -754,6 +722,16 @@ acpi_hw_low_level_read(u32 width, u32 * value, struct acpi_generic_address *reg)
754 if (!address) { 722 if (!address) {
755 return (AE_OK); 723 return (AE_OK);
756 } 724 }
725
726 /* Supported widths are 8/16/32 */
727
728 width = reg->bit_width;
729 if ((width != 8) && (width != 16) && (width != 32)) {
730 return (AE_SUPPORT);
731 }
732
733 /* Initialize entire 32-bit return value to zero */
734
757 *value = 0; 735 *value = 0;
758 736
759 /* 737 /*
@@ -787,12 +765,13 @@ acpi_hw_low_level_read(u32 width, u32 * value, struct acpi_generic_address *reg)
787 return (status); 765 return (status);
788} 766}
789 767
768ACPI_EXPORT_SYMBOL(acpi_read)
769
790/****************************************************************************** 770/******************************************************************************
791 * 771 *
792 * FUNCTION: acpi_hw_low_level_write 772 * FUNCTION: acpi_write
793 * 773 *
794 * PARAMETERS: Width - 8, 16, or 32 774 * PARAMETERS: Value - To be written
795 * Value - To be written
796 * Reg - GAS register structure 775 * Reg - GAS register structure
797 * 776 *
798 * RETURN: Status 777 * RETURN: Status
@@ -802,12 +781,13 @@ acpi_hw_low_level_read(u32 width, u32 * value, struct acpi_generic_address *reg)
802 ******************************************************************************/ 781 ******************************************************************************/
803 782
804acpi_status 783acpi_status
805acpi_hw_low_level_write(u32 width, u32 value, struct acpi_generic_address * reg) 784acpi_write(u32 value, struct acpi_generic_address *reg)
806{ 785{
786 u32 width;
807 u64 address; 787 u64 address;
808 acpi_status status; 788 acpi_status status;
809 789
810 ACPI_FUNCTION_NAME(hw_low_level_write); 790 ACPI_FUNCTION_NAME(acpi_write);
811 791
812 /* 792 /*
813 * Must have a valid pointer to a GAS structure, and 793 * Must have a valid pointer to a GAS structure, and
@@ -825,6 +805,13 @@ acpi_hw_low_level_write(u32 width, u32 value, struct acpi_generic_address * reg)
825 return (AE_OK); 805 return (AE_OK);
826 } 806 }
827 807
808 /* Supported widths are 8/16/32 */
809
810 width = reg->bit_width;
811 if ((width != 8) && (width != 16) && (width != 32)) {
812 return (AE_SUPPORT);
813 }
814
828 /* 815 /*
829 * Two address spaces supported: Memory or IO. 816 * Two address spaces supported: Memory or IO.
830 * PCI_Config is not supported here because the GAS struct is insufficient 817 * PCI_Config is not supported here because the GAS struct is insufficient
@@ -855,3 +842,5 @@ acpi_hw_low_level_write(u32 width, u32 value, struct acpi_generic_address * reg)
855 842
856 return (status); 843 return (status);
857} 844}
845
846ACPI_EXPORT_SYMBOL(acpi_write)
diff --git a/drivers/acpi/reboot.c b/drivers/acpi/reboot.c
index a6b662c00b67..b46fe52e96c5 100644
--- a/drivers/acpi/reboot.c
+++ b/drivers/acpi/reboot.c
@@ -42,7 +42,7 @@ void acpi_reboot(void)
42 case ACPI_ADR_SPACE_SYSTEM_MEMORY: 42 case ACPI_ADR_SPACE_SYSTEM_MEMORY:
43 case ACPI_ADR_SPACE_SYSTEM_IO: 43 case ACPI_ADR_SPACE_SYSTEM_IO:
44 printk(KERN_DEBUG "ACPI MEMORY or I/O RESET_REG.\n"); 44 printk(KERN_DEBUG "ACPI MEMORY or I/O RESET_REG.\n");
45 acpi_hw_low_level_write(8, reset_value, rr); 45 acpi_write(reset_value, rr);
46 break; 46 break;
47 } 47 }
48 /* Wait ten seconds */ 48 /* Wait ten seconds */
diff --git a/include/acpi/achware.h b/include/acpi/achware.h
index 960f8162ecfe..cd408103d268 100644
--- a/include/acpi/achware.h
+++ b/include/acpi/achware.h
@@ -75,13 +75,6 @@ acpi_hw_register_read(u32 register_id, u32 * return_value);
75 75
76acpi_status acpi_hw_register_write(u32 register_id, u32 value); 76acpi_status acpi_hw_register_write(u32 register_id, u32 value);
77 77
78acpi_status
79acpi_hw_low_level_read(u32 width,
80 u32 * value, struct acpi_generic_address *reg);
81
82acpi_status
83acpi_hw_low_level_write(u32 width, u32 value, struct acpi_generic_address *reg);
84
85acpi_status acpi_hw_clear_acpi_status(void); 78acpi_status acpi_hw_clear_acpi_status(void);
86 79
87/* 80/*
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index 6d8fb6fb35e0..030aeb556e6b 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -81,11 +81,6 @@ const char *acpi_format_exception(acpi_status exception);
81 81
82acpi_status acpi_purge_cached_objects(void); 82acpi_status acpi_purge_cached_objects(void);
83 83
84#ifdef ACPI_FUTURE_USAGE
85acpi_status
86acpi_install_initialization_handler(acpi_init_handler handler, u32 function);
87#endif
88
89/* 84/*
90 * ACPI Memory management 85 * ACPI Memory management
91 */ 86 */
@@ -195,9 +190,12 @@ acpi_status acpi_get_id(acpi_handle object, acpi_owner_id * out_type);
195acpi_status acpi_get_parent(acpi_handle object, acpi_handle * out_handle); 190acpi_status acpi_get_parent(acpi_handle object, acpi_handle * out_handle);
196 191
197/* 192/*
198 * Event handler interfaces 193 * Handler interfaces
199 */ 194 */
200acpi_status 195acpi_status
196acpi_install_initialization_handler(acpi_init_handler handler, u32 function);
197
198acpi_status
201acpi_install_fixed_event_handler(u32 acpi_event, 199acpi_install_fixed_event_handler(u32 acpi_event,
202 acpi_event_handler handler, void *context); 200 acpi_event_handler handler, void *context);
203 201
@@ -336,6 +334,10 @@ acpi_set_firmware_waking_vector(u32 physical_address);
336acpi_status 334acpi_status
337acpi_set_firmware_waking_vector64(u64 physical_address); 335acpi_set_firmware_waking_vector64(u64 physical_address);
338 336
337acpi_status acpi_read(u32 *value, struct acpi_generic_address *reg);
338
339acpi_status acpi_write(u32 value, struct acpi_generic_address *reg);
340
339acpi_status 341acpi_status
340acpi_get_sleep_type_data(u8 sleep_state, u8 * slp_typ_a, u8 * slp_typ_b); 342acpi_get_sleep_type_data(u8 sleep_state, u8 * slp_typ_a, u8 * slp_typ_b);
341 343