Attention is currently required from: Lance Zhao, Raul Rangel, Furquan Shaikh. Tim Wawrzynczak has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/55027 )
Change subject: acpi/device: Add ability to generate proper _STA for PowerResource ......................................................................
Patch Set 1:
(1 comment)
File src/acpi/device.c:
https://review.coreboot.org/c/coreboot/+/55027/comment/3485efe8_f881caa1 PS1, Line 605: acpigen_write_method If you're going to go with reading GPIOs, this needs to be Serialized, so it won't run with _ON or _OFF or be reentrant.
Honestly though, my thought for this was always to have a Name in the PowerResource that stores the state, like so:
``` PowerResource (FOO) { Name (STA, 0) // or maybe some way to set the default state if it's already ON Method (_ON) { ... // GPIOs STA = 1 } Method (_OFF) { .. // GPIOs STA = 0 } Method (_STA) { Return (STA) } } ```
WDYT? It's a little simpler (and faster too)