aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/ec.c
diff options
context:
space:
mode:
authorAlexey Starikovskiy <alexey.y.starikovskiy@intel.com>2007-03-07 14:28:00 -0500
committerLen Brown <len.brown@intel.com>2007-03-09 23:27:28 -0500
commit33c7a0738c5f753a7d94fd3b2ec7d84e79a141a8 (patch)
tree597e1880f74098280c3494968c6baf347d0b2ab8 /drivers/acpi/ec.c
parent33d20b6100d05a0b14883e7dc8ab41e4531fcf59 (diff)
ACPI: EC: "Fake ECDT" workaround is not needed any longer.
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/ec.c')
-rw-r--r--drivers/acpi/ec.c81
1 files changed, 0 insertions, 81 deletions
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index 7828ac5e5e7f..5999abd9909d 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -805,74 +805,6 @@ static int acpi_ec_stop(struct acpi_device *device, int type)
805 return 0; 805 return 0;
806} 806}
807 807
808static acpi_status __init
809acpi_fake_ecdt_callback(acpi_handle handle,
810 u32 Level, void *context, void **retval)
811{
812 acpi_status status;
813
814 mutex_init(&ec_ecdt->lock);
815 atomic_set(&ec_ecdt->event_count, 1);
816 if (acpi_ec_mode == EC_INTR) {
817 init_waitqueue_head(&ec_ecdt->wait);
818 }
819 status = acpi_walk_resources(handle, METHOD_NAME__CRS,
820 acpi_ec_io_ports, ec_ecdt);
821 if (ACPI_FAILURE(status))
822 return status;
823
824 ec_ecdt->uid = -1;
825 acpi_evaluate_integer(handle, "_UID", NULL, &ec_ecdt->uid);
826
827 status = acpi_evaluate_integer(handle, "_GPE", NULL, &ec_ecdt->gpe);
828 if (ACPI_FAILURE(status))
829 return status;
830 ec_ecdt->handle = handle;
831
832 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "GPE=0x%02lx, ports=0x%2lx, 0x%2lx",
833 ec_ecdt->gpe, ec_ecdt->command_addr,
834 ec_ecdt->data_addr));
835
836 return AE_CTRL_TERMINATE;
837}
838
839/*
840 * Some BIOS (such as some from Gateway laptops) access EC region very early
841 * such as in BAT0._INI or EC._INI before an EC device is found and
842 * do not provide an ECDT. According to ACPI spec, ECDT isn't mandatorily
843 * required, but if EC regison is accessed early, it is required.
844 * The routine tries to workaround the BIOS bug by pre-scan EC device
845 * It assumes that _CRS, _HID, _GPE, _UID methods of EC don't touch any
846 * op region (since _REG isn't invoked yet). The assumption is true for
847 * all systems found.
848 */
849static int __init acpi_ec_fake_ecdt(void)
850{
851 acpi_status status;
852 int ret = 0;
853
854 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Try to make an fake ECDT"));
855
856 ec_ecdt = kzalloc(sizeof(struct acpi_ec), GFP_KERNEL);
857 if (!ec_ecdt) {
858 ret = -ENOMEM;
859 goto error;
860 }
861
862 status = acpi_get_devices(ACPI_EC_HID,
863 acpi_fake_ecdt_callback, NULL, NULL);
864 if (ACPI_FAILURE(status)) {
865 kfree(ec_ecdt);
866 ec_ecdt = NULL;
867 ret = -ENODEV;
868 ACPI_EXCEPTION((AE_INFO, status, "Can't make an fake ECDT"));
869 goto error;
870 }
871 return 0;
872 error:
873 return ret;
874}
875
876static int __init acpi_ec_get_real_ecdt(void) 808static int __init acpi_ec_get_real_ecdt(void)
877{ 809{
878 acpi_status status; 810 acpi_status status;
@@ -916,18 +848,12 @@ static int __init acpi_ec_get_real_ecdt(void)
916 return -ENODEV; 848 return -ENODEV;
917} 849}
918 850
919static int __initdata acpi_fake_ecdt_enabled;
920int __init acpi_ec_ecdt_probe(void) 851int __init acpi_ec_ecdt_probe(void)
921{ 852{
922 acpi_status status; 853 acpi_status status;
923 int ret; 854 int ret;
924 855
925 ret = acpi_ec_get_real_ecdt(); 856 ret = acpi_ec_get_real_ecdt();
926 /* Try to make a fake ECDT */
927 if (ret && acpi_fake_ecdt_enabled) {
928 ret = acpi_ec_fake_ecdt();
929 }
930
931 if (ret) 857 if (ret)
932 return 0; 858 return 0;
933 859
@@ -1000,13 +926,6 @@ static void __exit acpi_ec_exit(void)
1000} 926}
1001#endif /* 0 */ 927#endif /* 0 */
1002 928
1003static int __init acpi_fake_ecdt_setup(char *str)
1004{
1005 acpi_fake_ecdt_enabled = 1;
1006 return 1;
1007}
1008
1009__setup("acpi_fake_ecdt", acpi_fake_ecdt_setup);
1010static int __init acpi_ec_set_intr_mode(char *str) 929static int __init acpi_ec_set_intr_mode(char *str)
1011{ 930{
1012 int intr; 931 int intr;