dm: acpi: Add support for the NHLT table

The Intel Non-High-Definition-Audio Link Table (NHLT) table describes the
audio codecs and connections in a system. Various devices can contribute
information to produce the table.

Add core support for this, based on a structure which is built up through
calls to the driver.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
diff --git a/drivers/core/acpi.c b/drivers/core/acpi.c
index ae69258..cdbc2c5 100644
--- a/drivers/core/acpi.c
+++ b/drivers/core/acpi.c
@@ -31,6 +31,7 @@
 	METHOD_WRITE_TABLES,
 	METHOD_FILL_SSDT,
 	METHOD_INJECT_DSDT,
+	METHOD_SETUP_NHLT,
 };
 
 /* Prototype for all methods */
@@ -248,6 +249,8 @@
 			return aops->fill_ssdt;
 		case METHOD_INJECT_DSDT:
 			return aops->inject_dsdt;
+		case METHOD_SETUP_NHLT:
+			return aops->setup_nhlt;
 		}
 	}
 
@@ -334,3 +337,15 @@
 
 	return ret;
 }
+
+int acpi_setup_nhlt(struct acpi_ctx *ctx, struct nhlt *nhlt)
+{
+	int ret;
+
+	log_debug("Setup NHLT\n");
+	ctx->nhlt = nhlt;
+	ret = acpi_recurse_method(ctx, dm_root(), METHOD_SETUP_NHLT, TYPE_NONE);
+	log_debug("Setup finished, err=%d\n", ret);
+
+	return ret;
+}