]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/acpi/ec.c
Merge branches 'bugzilla-12461' and 'bugzilla-9998' into release
[linux-2.6-omap-h63xx.git] / drivers / acpi / ec.c
index ac9dd3b386b1ee5fd663b64da9c96d325e363b84..03107bce03ed424e843fd8ec801de224804148e7 100644 (file)
@@ -765,6 +765,10 @@ ec_parse_device(acpi_handle handle, u32 Level, void *context, void **retval)
        unsigned long long tmp = 0;
 
        struct acpi_ec *ec = context;
+
+       /* clear addr values, ec_parse_io_ports depend on it */
+       ec->command_addr = ec->data_addr = 0;
+
        status = acpi_walk_resources(handle, METHOD_NAME__CRS,
                                     ec_parse_io_ports, ec);
        if (ACPI_FAILURE(status))
@@ -814,11 +818,11 @@ static int acpi_ec_add(struct acpi_device *device)
                ec = make_acpi_ec();
                if (!ec)
                        return -ENOMEM;
-               if (ec_parse_device(device->handle, 0, ec, NULL) !=
-                   AE_CTRL_TERMINATE) {
+       }
+       if (ec_parse_device(device->handle, 0, ec, NULL) !=
+               AE_CTRL_TERMINATE) {
                        kfree(ec);
                        return -EINVAL;
-               }
        }
 
        ec->handle = device->handle;
@@ -996,12 +1000,12 @@ int __init acpi_ec_ecdt_probe(void)
                boot_ec->handle = ACPI_ROOT_OBJECT;
                acpi_get_handle(ACPI_ROOT_OBJECT, ecdt_ptr->id, &boot_ec->handle);
                /* Don't trust ECDT, which comes from ASUSTek */
-               if (!dmi_name_in_vendors("ASUS"))
+               if (!dmi_name_in_vendors("ASUS") && EC_FLAGS_MSI == 0)
                        goto install;
                saved_ec = kmalloc(sizeof(struct acpi_ec), GFP_KERNEL);
                if (!saved_ec)
                        return -ENOMEM;
-               memcpy(saved_ec, boot_ec, sizeof(*saved_ec));
+               memcpy(saved_ec, boot_ec, sizeof(struct acpi_ec));
        /* fall through */
        }
        /* This workaround is needed only on some broken machines,
@@ -1079,13 +1083,10 @@ static struct acpi_driver acpi_ec_driver = {
                },
 };
 
-static int __init acpi_ec_init(void)
+int __init acpi_ec_init(void)
 {
        int result = 0;
 
-       if (acpi_disabled)
-               return 0;
-
        acpi_ec_dir = proc_mkdir(ACPI_EC_CLASS, acpi_root_dir);
        if (!acpi_ec_dir)
                return -ENODEV;
@@ -1100,8 +1101,6 @@ static int __init acpi_ec_init(void)
        return result;
 }
 
-subsys_initcall(acpi_ec_init);
-
 /* EC driver currently not unloadable */
 #if 0
 static void __exit acpi_ec_exit(void)