]> err.no Git - linux-2.6/blobdiff - drivers/acpi/ec.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland...
[linux-2.6] / drivers / acpi / ec.c
index 7d6b84119792955593449427b74e6ecde3030013..97dc16155a556d13c373535f767bc8faba76514f 100644 (file)
@@ -892,6 +892,17 @@ static int acpi_ec_stop(struct acpi_device *device, int type)
        return 0;
 }
 
+int __init acpi_boot_ec_enable(void)
+{
+       if (!boot_ec || boot_ec->handlers_installed)
+               return 0;
+       if (!ec_install_handlers(boot_ec)) {
+               first_ec = boot_ec;
+               return 0;
+       }
+       return -EFAULT;
+}
+
 int __init acpi_ec_ecdt_probe(void)
 {
        int ret;
@@ -913,12 +924,21 @@ int __init acpi_ec_ecdt_probe(void)
                boot_ec->gpe = ecdt_ptr->gpe;
                boot_ec->handle = ACPI_ROOT_OBJECT;
        } else {
+               /* This workaround is needed only on some broken machines,
+                * which require early EC, but fail to provide ECDT */
+               acpi_handle x;
                printk(KERN_DEBUG PREFIX "Look up EC in DSDT\n");
                status = acpi_get_devices(ec_device_ids[0].id, ec_parse_device,
                                                boot_ec, NULL);
                /* Check that acpi_get_devices actually find something */
                if (ACPI_FAILURE(status) || !boot_ec->handle)
                        goto error;
+               /* We really need to limit this workaround, the only ASUS,
+                * which needs it, has fake EC._INI method, so use it as flag.
+                * Keep boot_ec struct as it will be needed soon.
+                */
+               if (ACPI_FAILURE(acpi_get_handle(boot_ec->handle, "_INI", &x)))
+                       return -ENODEV;
        }
 
        ret = ec_install_handlers(boot_ec);