From e0a896b88f2e517b10c67a4f85f3846a0312041d Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Tue, 22 Sep 2020 12:44:56 -0600 Subject: 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 --- lib/acpi/acpigen.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib') 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) * -- cgit v1.1