@@ -594,6 +594,9 @@ config ACPI_PRMT
substantially increase computational overhead related to the
initialization of some server systems.
+config ACPI_NHLT
+ bool
+
endif # ACPI
config X86_PM_TIMER
@@ -93,6 +93,7 @@ obj-$(CONFIG_ACPI) += container.o
obj-$(CONFIG_ACPI_THERMAL) += thermal.o
obj-$(CONFIG_ACPI_PLATFORM_PROFILE) += platform_profile.o
obj-$(CONFIG_ACPI_NFIT) += nfit/
+obj-$(CONFIG_ACPI_NHLT) += nhlt.o
obj-$(CONFIG_ACPI_NUMA) += numa/
obj-$(CONFIG_ACPI) += acpi_memhotplug.o
obj-$(CONFIG_ACPI_HOTPLUG_IOAPIC) += ioapic.o
new file mode 100644
@@ -0,0 +1,13 @@
+// SPDX-License-Identifier: GPL-2.0-only
+//
+// Copyright(c) 2023 Intel Corporation. All rights reserved.
+//
+// Authors: Cezary Rojewski <cezary.rojewski@intel.com>
+// Amadeusz Slawinski <amadeuszx.slawinski@linux.intel.com>
+//
+
+#include <linux/export.h>
+#include <acpi/nhlt.h>
+
+struct acpi_table_nhlt *acpi_gbl_NHLT;
+EXPORT_SYMBOL_GPL(acpi_gbl_NHLT);
@@ -13,6 +13,24 @@
#include <linux/overflow.h>
#include <linux/types.h>
+/* System-wide pointer to the first NHLT table. */
+extern struct acpi_table_nhlt *acpi_gbl_NHLT;
+
+/*
+ * A sound driver may utilize the two below on its initialization and removal
+ * respectively to avoid excessive mapping and unmapping of the memory
+ * occupied by the table between streaming operations.
+ */
+static inline acpi_status acpi_nhlt_get_gbl_table(void)
+{
+ return acpi_get_table(ACPI_SIG_NHLT, 0, (struct acpi_table_header **)(&acpi_gbl_NHLT));
+}
+
+static inline void acpi_nhlt_put_gbl_table(void)
+{
+ acpi_put_table((struct acpi_table_header *)acpi_gbl_NHLT);
+}
+
#define __acpi_nhlt_endpoint_cfg(ep) ((void *)((ep) + 1))
/*