diff options
author | Michał Żygowski <michal.zygowski@3mdeb.com> | 2022-02-22 12:36:32 +0100 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2022-05-03 19:32:55 +0000 |
commit | 2b87b506bcae63b383b7ff75dc5c3e3cc856e8da (patch) | |
tree | 4581f8d02998eaf358cf88f0c0d3b7b8c832bb5d /src/soc | |
parent | 08c2217192ad44c08cf8635d2de31c4fc32de071 (diff) |
intelblocks/pep: Add display on/off notifications
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 (when display goes off from inactivity or on from
activity).
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>
Signed-off-by: Michał Kopeć <michal.kopec@3mdeb.com>
Change-Id: Ie80f631ecffa74467ab6d6162e552ba977f7e3f4
Reviewed-on: https://review.coreboot.org/c/coreboot/+/62494
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Krystian Hebel <krystian.hebel@3mdeb.com>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'src/soc')
-rw-r--r-- | src/soc/intel/common/block/acpi/pep.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/src/soc/intel/common/block/acpi/pep.c b/src/soc/intel/common/block/acpi/pep.c index b83b71491f..139943865f 100644 --- a/src/soc/intel/common/block/acpi/pep.c +++ b/src/soc/intel/common/block/acpi/pep.c @@ -14,6 +14,7 @@ #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 LPI_STATES_ALL 0xff @@ -150,12 +151,30 @@ static void lpi_s0ix_exit(void *unused) 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 */ }; |