mb/google/dedede: Resume from suspend on critical battery

This patch makes dedede EC wake up AP from s0ix when the state of
charge drops to low_battery_shutdown_percent.

Demonstrated as follows:

1. Boot OS.
2. Run powerd_dbus_suspend.
3. On EC, run battfake 4.
4. System resumes.

BUG=b:244253629
TEST=Verified on dedede

Change-Id: I39234d2b9e739383b5f96be49077f8c9831fa0fa
Signed-off-by: Ivan Chen <yulunchen@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/67320
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nick Vaccaro <nvaccaro@google.com>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
This commit is contained in:
Ivan Chen 2022-09-03 11:17:43 +08:00 committed by Martin Roth
parent 92d3899790
commit a657b1f7ce
1 changed files with 5 additions and 1 deletions

View File

@ -39,6 +39,7 @@
* 3. Key press * 3. Key press
* 4. Mode change * 4. Mode change
* 5. AC Connect/Disconnect * 5. AC Connect/Disconnect
* 6. Low battery
*/ */
#define MAINBOARD_EC_S3_WAKE_EVENTS \ #define MAINBOARD_EC_S3_WAKE_EVENTS \
(MAINBOARD_EC_S5_WAKE_EVENTS |\ (MAINBOARD_EC_S5_WAKE_EVENTS |\
@ -47,7 +48,10 @@
EC_HOST_EVENT_MASK(EC_HOST_EVENT_KEY_PRESSED) |\ 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))
#define MAINBOARD_EC_S0IX_WAKE_EVENTS (MAINBOARD_EC_S3_WAKE_EVENTS) #define MAINBOARD_EC_S0IX_WAKE_EVENTS \
(MAINBOARD_EC_S3_WAKE_EVENTS |\
EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY_CRITICAL) |\
EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY_SHUTDOWN))
/* Log EC wake events plus EC shutdown events */ /* Log EC wake events plus EC shutdown events */
#define MAINBOARD_EC_LOG_EVENTS \ #define MAINBOARD_EC_LOG_EVENTS \