diff options
author | Simon Glass <sjg@chromium.org> | 2020-09-22 12:44:56 -0600 |
---|---|---|
committer | Bin Meng <bmeng.cn@gmail.com> | 2020-09-25 11:27:13 +0800 |
commit | e0a896b88f2e517b10c67a4f85f3846a0312041d (patch) | |
tree | 37d262b871bb50c74139da14c8f2844661883789 /lib/acpi | |
parent | 99e555a79ab882eb8b38886fa5dab053d4d64bfa (diff) | |
download | u-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/acpi')
-rw-r--r-- | lib/acpi/acpigen.c | 10 |
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) * |