diff options
author | Alexey Starikovskiy <astarikovskiy@suse.de> | 2009-04-01 01:33:15 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2009-04-01 01:33:15 -0400 |
commit | a5032bfdd9c80e0231a6324661e123818eb46ecd (patch) | |
tree | b4f515d95bac7ab69adaba5b966af4d9689012f1 /drivers/acpi/ec.c | |
parent | 8e0ee43bc2c3e19db56a4adaa9a9b04ce885cd84 (diff) |
ACPI: EC: Always parse EC device
If ECDT info is not valid, we have last chance to configure
EC driver properly at this point, don't miss it.
http://bugzilla.kernel.org/show_bug.cgi?id=12461
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/ec.c')
-rw-r--r-- | drivers/acpi/ec.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index 2fe15060dcdc..5a2d5372ea39 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c | |||
@@ -755,6 +755,10 @@ ec_parse_device(acpi_handle handle, u32 Level, void *context, void **retval) | |||
755 | unsigned long long tmp = 0; | 755 | unsigned long long tmp = 0; |
756 | 756 | ||
757 | struct acpi_ec *ec = context; | 757 | struct acpi_ec *ec = context; |
758 | |||
759 | /* clear addr values, ec_parse_io_ports depend on it */ | ||
760 | ec->command_addr = ec->data_addr = 0; | ||
761 | |||
758 | status = acpi_walk_resources(handle, METHOD_NAME__CRS, | 762 | status = acpi_walk_resources(handle, METHOD_NAME__CRS, |
759 | ec_parse_io_ports, ec); | 763 | ec_parse_io_ports, ec); |
760 | if (ACPI_FAILURE(status)) | 764 | if (ACPI_FAILURE(status)) |
@@ -804,11 +808,11 @@ static int acpi_ec_add(struct acpi_device *device) | |||
804 | ec = make_acpi_ec(); | 808 | ec = make_acpi_ec(); |
805 | if (!ec) | 809 | if (!ec) |
806 | return -ENOMEM; | 810 | return -ENOMEM; |
807 | if (ec_parse_device(device->handle, 0, ec, NULL) != | 811 | } |
808 | AE_CTRL_TERMINATE) { | 812 | if (ec_parse_device(device->handle, 0, ec, NULL) != |
813 | AE_CTRL_TERMINATE) { | ||
809 | kfree(ec); | 814 | kfree(ec); |
810 | return -EINVAL; | 815 | return -EINVAL; |
811 | } | ||
812 | } | 816 | } |
813 | 817 | ||
814 | ec->handle = device->handle; | 818 | ec->handle = device->handle; |
@@ -986,12 +990,12 @@ int __init acpi_ec_ecdt_probe(void) | |||
986 | boot_ec->handle = ACPI_ROOT_OBJECT; | 990 | boot_ec->handle = ACPI_ROOT_OBJECT; |
987 | acpi_get_handle(ACPI_ROOT_OBJECT, ecdt_ptr->id, &boot_ec->handle); | 991 | acpi_get_handle(ACPI_ROOT_OBJECT, ecdt_ptr->id, &boot_ec->handle); |
988 | /* Don't trust ECDT, which comes from ASUSTek */ | 992 | /* Don't trust ECDT, which comes from ASUSTek */ |
989 | if (!dmi_name_in_vendors("ASUS")) | 993 | if (!dmi_name_in_vendors("ASUS") && EC_FLAGS_MSI == 0) |
990 | goto install; | 994 | goto install; |
991 | saved_ec = kmalloc(sizeof(struct acpi_ec), GFP_KERNEL); | 995 | saved_ec = kmalloc(sizeof(struct acpi_ec), GFP_KERNEL); |
992 | if (!saved_ec) | 996 | if (!saved_ec) |
993 | return -ENOMEM; | 997 | return -ENOMEM; |
994 | memcpy(saved_ec, boot_ec, sizeof(*saved_ec)); | 998 | memcpy(saved_ec, boot_ec, sizeof(struct acpi_ec)); |
995 | /* fall through */ | 999 | /* fall through */ |
996 | } | 1000 | } |
997 | /* This workaround is needed only on some broken machines, | 1001 | /* This workaround is needed only on some broken machines, |