diff mbox series

[040/108] dm: core: Add an ACPI name for the root node

Message ID 20200126220508.40.I3fc26919ac73d55741c6ee8098cc0d6df70bb23c@changeid
State Superseded
Headers show
Series RFC: dm: Add programatic generation of ACPI tables | expand

Commit Message

Simon Glass Jan. 27, 2020, 5:05 a.m. UTC
This always has a fixed ACPI name so add it as a driver function.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 drivers/core/root.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
diff mbox series

Patch

diff --git a/drivers/core/root.c b/drivers/core/root.c
index e85643819e..431c8c7246 100644
--- a/drivers/core/root.c
+++ b/drivers/core/root.c
@@ -11,6 +11,7 @@ 
 #include <fdtdec.h>
 #include <malloc.h>
 #include <linux/libfdt.h>
+#include <dm/acpi.h>
 #include <dm/device.h>
 #include <dm/device-internal.h>
 #include <dm/lists.h>
@@ -390,10 +391,22 @@  int dm_init_and_scan(bool pre_reloc_only)
 	return 0;
 }
 
+#ifdef CONFIG_ACPIGEN
+static int root_acpi_get_name(const struct udevice *dev, char *out_name)
+{
+	return acpi_return_name(out_name, "\\_SB");
+}
+
+struct acpi_ops root_acpi_ops = {
+	.get_name	= root_acpi_get_name,
+};
+#endif
+
 /* This is the root driver - all drivers are children of this */
 U_BOOT_DRIVER(root_driver) = {
 	.name	= "root_driver",
 	.id	= UCLASS_ROOT,
+	acpi_ops_ptr(&root_acpi_ops)
 };
 
 /* This is the root uclass */