aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/acpi/ec.c14
-rw-r--r--drivers/acpi/scan.c6
2 files changed, 19 insertions, 1 deletions
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index d411017f8c06..97dc16155a55 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -892,6 +892,17 @@ static int acpi_ec_stop(struct acpi_device *device, int type)
892 return 0; 892 return 0;
893} 893}
894 894
895int __init acpi_boot_ec_enable(void)
896{
897 if (!boot_ec || boot_ec->handlers_installed)
898 return 0;
899 if (!ec_install_handlers(boot_ec)) {
900 first_ec = boot_ec;
901 return 0;
902 }
903 return -EFAULT;
904}
905
895int __init acpi_ec_ecdt_probe(void) 906int __init acpi_ec_ecdt_probe(void)
896{ 907{
897 int ret; 908 int ret;
@@ -924,9 +935,10 @@ int __init acpi_ec_ecdt_probe(void)
924 goto error; 935 goto error;
925 /* We really need to limit this workaround, the only ASUS, 936 /* We really need to limit this workaround, the only ASUS,
926 * which needs it, has fake EC._INI method, so use it as flag. 937 * which needs it, has fake EC._INI method, so use it as flag.
938 * Keep boot_ec struct as it will be needed soon.
927 */ 939 */
928 if (ACPI_FAILURE(acpi_get_handle(boot_ec->handle, "_INI", &x))) 940 if (ACPI_FAILURE(acpi_get_handle(boot_ec->handle, "_INI", &x)))
929 goto error; 941 return -ENODEV;
930 } 942 }
931 943
932 ret = ec_install_handlers(boot_ec); 944 ret = ec_install_handlers(boot_ec);
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 5b4d462117cf..cbfe9ae7a9e5 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -1449,6 +1449,8 @@ static int acpi_bus_scan_fixed(struct acpi_device *root)
1449 return result; 1449 return result;
1450} 1450}
1451 1451
1452int __init acpi_boot_ec_enable(void);
1453
1452static int __init acpi_scan_init(void) 1454static int __init acpi_scan_init(void)
1453{ 1455{
1454 int result; 1456 int result;
@@ -1480,6 +1482,10 @@ static int __init acpi_scan_init(void)
1480 * Enumerate devices in the ACPI namespace. 1482 * Enumerate devices in the ACPI namespace.
1481 */ 1483 */
1482 result = acpi_bus_scan_fixed(acpi_root); 1484 result = acpi_bus_scan_fixed(acpi_root);
1485
1486 /* EC region might be needed at bus_scan, so enable it now */
1487 acpi_boot_ec_enable();
1488
1483 if (!result) 1489 if (!result)
1484 result = acpi_bus_scan(acpi_root, &ops); 1490 result = acpi_bus_scan(acpi_root, &ops);
1485 1491