diff options
author | Simon Glass | 2020-07-07 21:32:14 -0600 |
---|---|---|
committer | Bin Meng | 2020-07-17 14:32:24 +0800 |
commit | 91c2f9c32ed76269b9786a6c506233e9b91bdfce (patch) | |
tree | 14de5d060315332b66350acf58885c6aa14d608b /lib/acpi/acpigen.c | |
parent | 70303d24809599e14f97f8ef08364ac6589410f4 (diff) |
acpi: Support generation of a device
Allow writing an ACPI device to the generated ACPI code.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
[bmeng: Fix build failures on Sandbox]
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'lib/acpi/acpigen.c')
-rw-r--r-- | lib/acpi/acpigen.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/acpi/acpigen.c b/lib/acpi/acpigen.c index 45691b79610..a66601a1383 100644 --- a/lib/acpi/acpigen.c +++ b/lib/acpi/acpigen.c @@ -291,6 +291,13 @@ void acpigen_write_method_serialized(struct acpi_ctx *ctx, const char *name, ACPI_METHOD_SERIALIZED_MASK); } +void acpigen_write_device(struct acpi_ctx *ctx, const char *name) +{ + acpigen_emit_ext_op(ctx, DEVICE_OP); + acpigen_write_len_f(ctx); + acpigen_emit_namestring(ctx, name); +} + void acpigen_write_sta(struct acpi_ctx *ctx, uint status) { /* Method (_STA, 0, NotSerialized) { Return (status) } */ |