From 19248226f57da01085a75f8b237cf3bf8579595c Mon Sep 17 00:00:00 2001 From: Ivan Chen Date: Fri, 17 Feb 2023 16:32:55 +0800 Subject: mb/google/*: Resume from suspend on critical battery This patch makes EC wake up AP from s3/s0ix for OS shutdown/hibernate when the state of charge drops to low_battery_shutdown_percent. BUG=b:255465618 TEST=emerge-nissa chromeos-bootimage (EC: https://crrev.com/c/4243898) Verify system resumes from s0ix and then enter S5 on nivviks with steps: 1. disconnect AC 2. powerd_dbus_suspend --disable_dark_resume=false 3. fakebatt 5 4. fakebatt 4 Change-Id: I63b5246432687e38ddfc5733ac3a115c3456d7e9 Signed-off-by: Ivan Chen Reviewed-on: https://review.coreboot.org/c/coreboot/+/73082 Reviewed-by: Subrata Banik Tested-by: build bot (Jenkins) Reviewed-by: Derek Huang --- src/mainboard/google/skyrim/variants/baseboard/include/baseboard/ec.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/mainboard/google/skyrim/variants') diff --git a/src/mainboard/google/skyrim/variants/baseboard/include/baseboard/ec.h b/src/mainboard/google/skyrim/variants/baseboard/include/baseboard/ec.h index 973e613f9e..1f5404609c 100644 --- a/src/mainboard/google/skyrim/variants/baseboard/include/baseboard/ec.h +++ b/src/mainboard/google/skyrim/variants/baseboard/include/baseboard/ec.h @@ -38,7 +38,9 @@ | EC_HOST_EVENT_MASK(EC_HOST_EVENT_AC_CONNECTED) \ | EC_HOST_EVENT_MASK(EC_HOST_EVENT_AC_DISCONNECTED) \ | EC_HOST_EVENT_MASK(EC_HOST_EVENT_KEY_PRESSED) \ - | EC_HOST_EVENT_MASK(EC_HOST_EVENT_MODE_CHANGE)) + | EC_HOST_EVENT_MASK(EC_HOST_EVENT_MODE_CHANGE) \ + | EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY_CRITICAL) \ + | EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY_SHUTDOWN)) #define MAINBOARD_EC_S0IX_WAKE_EVENTS (MAINBOARD_EC_S3_WAKE_EVENTS) -- cgit v1.2.3