Merge branches 'acpi-ec', 'acpi-apei', 'acpi-soc' and 'acpi-misc'
[linux-2.6-microblaze.git] / drivers / acpi / ec.c
index 1356562..e629e89 100644 (file)
@@ -183,6 +183,7 @@ static struct workqueue_struct *ec_query_wq;
 
 static int EC_FLAGS_CORRECT_ECDT; /* Needs ECDT port address correction */
 static int EC_FLAGS_IGNORE_DSDT_GPE; /* Needs ECDT GPE as correction setting */
+static int EC_FLAGS_TRUST_DSDT_GPE; /* Needs DSDT GPE as correction setting */
 static int EC_FLAGS_CLEAR_ON_RESUME; /* Needs acpi_ec_clear() on boot/resume */
 
 /* --------------------------------------------------------------------------
@@ -1593,7 +1594,8 @@ static int acpi_ec_add(struct acpi_device *device)
                }
 
                if (boot_ec && ec->command_addr == boot_ec->command_addr &&
-                   ec->data_addr == boot_ec->data_addr) {
+                   ec->data_addr == boot_ec->data_addr &&
+                   !EC_FLAGS_TRUST_DSDT_GPE) {
                        /*
                         * Trust PNP0C09 namespace location rather than
                         * ECDT ID. But trust ECDT GPE rather than _GPE
@@ -1627,7 +1629,7 @@ static int acpi_ec_add(struct acpi_device *device)
        WARN(!ret, "Could not request EC cmd io port 0x%lx", ec->command_addr);
 
        /* Reprobe devices depending on the EC */
-       acpi_walk_dep_device_list(ec->handle);
+       acpi_dev_clear_dependencies(device);
 
        acpi_handle_debug(ec->handle, "enumerated.\n");
        return 0;
@@ -1816,6 +1818,18 @@ static int ec_correct_ecdt(const struct dmi_system_id *id)
        return 0;
 }
 
+/*
+ * Some ECDTs contain wrong GPE setting, but they share the same port addresses
+ * with DSDT EC, don't duplicate the DSDT EC with ECDT EC in this case.
+ * https://bugzilla.kernel.org/show_bug.cgi?id=209989
+ */
+static int ec_honor_dsdt_gpe(const struct dmi_system_id *id)
+{
+       pr_debug("Detected system needing DSDT GPE setting.\n");
+       EC_FLAGS_TRUST_DSDT_GPE = 1;
+       return 0;
+}
+
 /*
  * Some DSDTs contain wrong GPE setting.
  * Asus FX502VD/VE, GL702VMK, X550VXK, X580VD
@@ -1846,6 +1860,22 @@ static const struct dmi_system_id ec_dmi_table[] __initconst = {
        DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
        DMI_MATCH(DMI_PRODUCT_NAME, "GL702VMK"),}, NULL},
        {
+       ec_honor_ecdt_gpe, "ASUSTeK COMPUTER INC. X505BA", {
+       DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
+       DMI_MATCH(DMI_PRODUCT_NAME, "X505BA"),}, NULL},
+       {
+       ec_honor_ecdt_gpe, "ASUSTeK COMPUTER INC. X505BP", {
+       DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
+       DMI_MATCH(DMI_PRODUCT_NAME, "X505BP"),}, NULL},
+       {
+       ec_honor_ecdt_gpe, "ASUSTeK COMPUTER INC. X542BA", {
+       DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
+       DMI_MATCH(DMI_PRODUCT_NAME, "X542BA"),}, NULL},
+       {
+       ec_honor_ecdt_gpe, "ASUSTeK COMPUTER INC. X542BP", {
+       DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
+       DMI_MATCH(DMI_PRODUCT_NAME, "X542BP"),}, NULL},
+       {
        ec_honor_ecdt_gpe, "ASUS X550VXK", {
        DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
        DMI_MATCH(DMI_PRODUCT_NAME, "X550VXK"),}, NULL},
@@ -1854,6 +1884,11 @@ static const struct dmi_system_id ec_dmi_table[] __initconst = {
        DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
        DMI_MATCH(DMI_PRODUCT_NAME, "X580VD"),}, NULL},
        {
+       /* https://bugzilla.kernel.org/show_bug.cgi?id=209989 */
+       ec_honor_dsdt_gpe, "HP Pavilion Gaming Laptop 15-cx0xxx", {
+       DMI_MATCH(DMI_SYS_VENDOR, "HP"),
+       DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion Gaming Laptop 15-cx0xxx"),}, NULL},
+       {
        ec_clear_on_resume, "Samsung hardware", {
        DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD.")}, NULL},
        {},