acpi/device: Add ability to generate proper _STA for PowerResource

acpi_device_add_power_res currently generates a `_STA` method hardcoded
to ON. This change enables the ability to generate a `_STA` method that
queries the status of the GPIOs to determine if the power resource is ON
or OFF.

BUG=b:184617186
TEST=Dump SSDT table for guybrush

Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Change-Id: I91410556db002c620fd9aaa99981457808da93a5
Reviewed-on: https://review.coreboot.org/c/coreboot/+/55027
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Lance Zhao
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
This commit is contained in:
Raul E Rangel
2021-05-27 15:04:21 -06:00
committed by Werner Zeh
parent fec4db954e
commit 6d2bc001ea
2 changed files with 56 additions and 2 deletions

View File

@@ -456,6 +456,12 @@ struct acpi_power_res_params {
* (_OFF method delay)
*/
unsigned int stop_off_delay_ms;
/* Write a _STA method that uses the state of the GPIOs to determine if
* the PowerResource is ON or OFF. If this is false, the _STA method
* will always return ON.
*/
bool use_gpio_for_status;
};
/*