Attention is currently required from: Michał Żygowski, Patrick Rudolph. Hello Michał Żygowski,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/62494
to review the following change.
Change subject: intelblocks/pep: Add display on/off notifications and handle TBT displays ......................................................................
intelblocks/pep: Add display on/off notifications and handle TBT displays
Add display on and off notifications which call mainboard hooks if present. This allows to handle some board specific functions in user absence or presence (whe ndisplay goes off from inactivity or on from activity).
Additionally notify IOM to enable or disable TBT displays on S0ix exit and entry respectively.
TEST=Use Display on/off notification on Clevo NV41 to tell EC about laptop inactivity. It is necessary to properly handle S0ix entry (stop the fans and start blinking the power led).
Signed-off-by: Michał Żygowski michal.zygowski@3mdeb.com Change-Id: Ie80f631ecffa74467ab6d6162e552ba977f7e3f4 --- M src/soc/intel/common/block/acpi/pep.c 1 file changed, 33 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/94/62494/1
diff --git a/src/soc/intel/common/block/acpi/pep.c b/src/soc/intel/common/block/acpi/pep.c index 8419a33..8ca823b 100644 --- a/src/soc/intel/common/block/acpi/pep.c +++ b/src/soc/intel/common/block/acpi/pep.c @@ -14,8 +14,11 @@ #define SYSTEM_POWER_MANAGEMENT_CID "PNP0D80" #define EC_S0IX_HOOK "\_SB.PCI0.LPCB.EC0.S0IX" #define MAINBOARD_HOOK "\_SB.MS0X" +#define MAINBOARD_DISPLAY_HOOK "\_SB.MDSX" #define ENABLE_PM_BITS_HOOK "\_SB.PCI0.EGPM" #define RESTORE_PM_BITS_HOOK "\_SB.PCI0.RGPM" +#define THUNDERBOLT_DEVICE "\_SB.PCI0.TXHC" +#define THUNDERBOLT_IOM_DPOF "\_SB.PCI0.DPOF" #define LPI_STATES_ALL 0xff #define MIN_DEVICE_STATE ACPI_DEVICE_SLEEP_D0 #define PEPD_SCOPE "\_SB.PCI0" @@ -125,6 +128,11 @@ acpigen_write_if_cond_ref_of(ENABLE_PM_BITS_HOOK); acpigen_emit_namestring(ENABLE_PM_BITS_HOOK); acpigen_write_if_end(); + + /* Handle Thunderbolt displays */ + acpigen_write_if_cond_ref_of(THUNDERBOLT_DEVICE); + acpigen_write_store_int_to_namestr(1, THUNDERBOLT_IOM_DPOF); + acpigen_write_if_end(); }
static void lpi_s0ix_exit(void *unused) @@ -145,14 +153,37 @@ acpigen_write_if_cond_ref_of(RESTORE_PM_BITS_HOOK); acpigen_emit_namestring(RESTORE_PM_BITS_HOOK); acpigen_write_if_end(); + + /* Handle Thunderbolt displays */ + acpigen_write_if_cond_ref_of(THUNDERBOLT_DEVICE); + acpigen_write_store_int_to_namestr(0, THUNDERBOLT_IOM_DPOF); + acpigen_write_if_end(); +} + +static void lpi_display_on(void *unused) +{ + /* Provide a board level S0ix hook */ + acpigen_write_if_cond_ref_of(MAINBOARD_DISPLAY_HOOK); + acpigen_emit_namestring(MAINBOARD_DISPLAY_HOOK); + acpigen_write_integer(1); + acpigen_write_if_end(); +} + +static void lpi_display_off(void *unused) +{ + /* Provide a board level S0ix hook */ + acpigen_write_if_cond_ref_of(MAINBOARD_DISPLAY_HOOK); + acpigen_emit_namestring(MAINBOARD_DISPLAY_HOOK); + acpigen_write_integer(0); + acpigen_write_if_end(); }
static void (*lpi_s0_helpers[])(void *) = { NULL, /* enumerate functions (autogenerated) */ lpi_get_constraints, /* get device constraints */ NULL, /* get crash dump device */ - NULL, /* display off notify */ - NULL, /* display on notify */ + lpi_display_off, /* display off notify */ + lpi_display_on, /* display on notify */ lpi_s0ix_entry, /* s0ix entry */ lpi_s0ix_exit, /* s0ix exit */ };