]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ACPI / tables: add DSDT AmlCode new declaration name support
authorWang Dongsheng <dongsheng.wang@hxt-semitech.com>
Tue, 13 Nov 2018 10:46:23 +0000 (18:46 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 13 Dec 2018 22:07:37 +0000 (23:07 +0100)
A new naming rule was added in ACPICA version 20180427 changing
the DSDT AML code name from "AmlCode" to "dsdt_aml_code".

That change was made by commit 83b2fa943ba8 "ACPICA: iASL: Enhance
the -tc option (create AML hex file in C)".

Tested:
ACPICA release version 20180427+.
ARM64: QCOM QDF2400
GCC: 4.8.5 20150623

Signed-off-by: Wang Dongsheng <dongsheng.wang@hxt-semitech.com>
[ rjw: Changelog ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/Kconfig
drivers/acpi/tables.c

index 7cea769c37df55b50c55a7e8751a05057b5348cd..618afeefbc7354370c2524ec64f439c7d0c24fe8 100644 (file)
@@ -336,7 +336,7 @@ config ACPI_CUSTOM_DSDT_FILE
          See Documentation/acpi/dsdt-override.txt
 
          Enter the full path name to the file which includes the AmlCode
-         declaration.
+         or dsdt_aml_code declaration.
 
          If unsure, don't enter a file name.
 
index 61203eebf3a1ae8cc3e70a7658b49cd39a8f249a..ccb90eff00e5e24585785c663f2215cf8708c67b 100644 (file)
@@ -712,6 +712,9 @@ acpi_os_physical_table_override(struct acpi_table_header *existing_table,
                                          table_length);
 }
 
+static void *amlcode __attribute__ ((weakref("AmlCode")));
+static void *dsdt_amlcode __attribute__ ((weakref("dsdt_aml_code")));
+
 acpi_status
 acpi_os_table_override(struct acpi_table_header *existing_table,
                       struct acpi_table_header **new_table)
@@ -722,8 +725,11 @@ acpi_os_table_override(struct acpi_table_header *existing_table,
        *new_table = NULL;
 
 #ifdef CONFIG_ACPI_CUSTOM_DSDT
-       if (strncmp(existing_table->signature, "DSDT", 4) == 0)
-               *new_table = (struct acpi_table_header *)AmlCode;
+       if (!strncmp(existing_table->signature, "DSDT", 4)) {
+               *new_table = (struct acpi_table_header *)&amlcode;
+               if (!(*new_table))
+                       *new_table = (struct acpi_table_header *)&dsdt_amlcode;
+       }
 #endif
        if (*new_table != NULL)
                acpi_table_taint(existing_table);