diff options
author | Simon Glass <sjg@chromium.org> | 2020-07-07 13:11:38 -0600 |
---|---|---|
committer | Bin Meng <bmeng.cn@gmail.com> | 2020-07-17 14:32:24 +0800 |
commit | 4b724a13770c39ee3806dd30d349b6f8d03cfbc6 (patch) | |
tree | 50b8ea58b67384b616fd7deca111181e4dfb6024 | |
parent | 0990c894cc2e8e94a2b049e4c83d484d0b3afd9c (diff) | |
download | u-boot-4b724a13770c39ee3806dd30d349b6f8d03cfbc6.tar.gz u-boot-4b724a13770c39ee3806dd30d349b6f8d03cfbc6.tar.bz2 u-boot-4b724a13770c39ee3806dd30d349b6f8d03cfbc6.zip |
dm: core: Add an ACPI name for the root node
This always has a fixed ACPI name so add it as a driver function.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
-rw-r--r-- | drivers/core/root.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/core/root.c b/drivers/core/root.c index 0de5d7c70d..0726be6b79 100644 --- a/drivers/core/root.c +++ b/drivers/core/root.c @@ -12,6 +12,7 @@ #include <log.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> @@ -377,10 +378,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_copy_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 */ |