aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-09-22 12:44:56 -0600
committerBin Meng <bmeng.cn@gmail.com>2020-09-25 11:27:13 +0800
commite0a896b88f2e517b10c67a4f85f3846a0312041d (patch)
tree37d262b871bb50c74139da14c8f2844661883789 /lib
parent99e555a79ab882eb8b38886fa5dab053d4d64bfa (diff)
downloadu-boot-e0a896b88f2e517b10c67a4f85f3846a0312041d.zip
u-boot-e0a896b88f2e517b10c67a4f85f3846a0312041d.tar.gz
u-boot-e0a896b88f2e517b10c67a4f85f3846a0312041d.tar.bz2
acpi: Add support for writing a _PRW
A 'Power Resource for Wake' list the resources a device depends on for wake. Add a function to generate this. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/acpi/acpigen.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/acpi/acpigen.c b/lib/acpi/acpigen.c
index c609ef4..527de89 100644
--- a/lib/acpi/acpigen.c
+++ b/lib/acpi/acpigen.c
@@ -426,6 +426,16 @@ void acpigen_write_register_resource(struct acpi_ctx *ctx,
acpigen_write_resourcetemplate_footer(ctx);
}
+void acpigen_write_prw(struct acpi_ctx *ctx, uint wake, uint level)
+{
+ /* Name (_PRW, Package () { wake, level } */
+ acpigen_write_name(ctx, "_PRW");
+ acpigen_write_package(ctx, 2);
+ acpigen_write_integer(ctx, wake);
+ acpigen_write_integer(ctx, level);
+ acpigen_pop_len(ctx);
+}
+
/*
* ToUUID(uuid)
*