aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/tables.c
diff options
context:
space:
mode:
authorWang Dongsheng <dongsheng.wang@hxt-semitech.com>2018-11-13 18:46:23 +0800
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2018-12-13 23:07:37 +0100
commit82e4eb4e96539c76518425a5b5a6c56fa400bce3 (patch)
tree184b2ed3b5c10011e99ca47e52b3e5fcf2a8528f /drivers/acpi/tables.c
parentACPI: SPCR: Consider baud rate 0 as preconfigured state (diff)
downloadlinux-dev-82e4eb4e96539c76518425a5b5a6c56fa400bce3.tar.xz
linux-dev-82e4eb4e96539c76518425a5b5a6c56fa400bce3.zip
ACPI / tables: add DSDT AmlCode new declaration name support
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>
Diffstat (limited to 'drivers/acpi/tables.c')
-rw-r--r--drivers/acpi/tables.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c
index 61203eebf3a1..ccb90eff00e5 100644
--- a/drivers/acpi/tables.c
+++ b/drivers/acpi/tables.c
@@ -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);