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 <yulunchen@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/73082 Reviewed-by: Subrata Banik <subratabanik@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Derek Huang <derekhuang@google.com>
This commit is contained in:
parent
68107ddcbc
commit
19248226f5
|
@ -36,13 +36,16 @@
|
|||
* 3. Power button
|
||||
* 4. Key press
|
||||
* 5. Mode change
|
||||
* 6. Low battery
|
||||
*/
|
||||
#define MAINBOARD_EC_S3_WAKE_EVENTS \
|
||||
(MAINBOARD_EC_S5_WAKE_EVENTS |\
|
||||
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 |\
|
||||
EC_HOST_EVENT_MASK(EC_HOST_EVENT_USB_MUX) |\
|
||||
|
|
|
@ -39,13 +39,16 @@
|
|||
* 3. AC Connect/Disconnect
|
||||
* 4. Key press
|
||||
* 5. Mode change
|
||||
* 6. Low battery
|
||||
*/
|
||||
#define MAINBOARD_EC_S3_WAKE_EVENTS \
|
||||
(MAINBOARD_EC_S5_WAKE_EVENTS |\
|
||||
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 |\
|
||||
|
|
|
@ -36,13 +36,16 @@
|
|||
* 3. Power button
|
||||
* 4. Key press
|
||||
* 5. Mode change
|
||||
* 6. Low battery
|
||||
*/
|
||||
#define MAINBOARD_EC_S3_WAKE_EVENTS \
|
||||
(MAINBOARD_EC_S5_WAKE_EVENTS |\
|
||||
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 |\
|
||||
EC_HOST_EVENT_MASK(EC_HOST_EVENT_USB_MUX) |\
|
||||
|
|
|
@ -36,13 +36,16 @@
|
|||
* 3. Power button
|
||||
* 4. Key press
|
||||
* 5. Mode change
|
||||
* 6. Low battery
|
||||
*/
|
||||
#define MAINBOARD_EC_S3_WAKE_EVENTS \
|
||||
(MAINBOARD_EC_S5_WAKE_EVENTS |\
|
||||
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 |\
|
||||
EC_HOST_EVENT_MASK(EC_HOST_EVENT_USB_MUX) |\
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue