diff options
-rw-r--r-- | common/mkbp_event.c | 4 | ||||
-rw-r--r-- | include/ec_commands.h | 4 | ||||
-rw-r--r-- | util/ectool.c | 5 |
3 files changed, 10 insertions, 3 deletions
diff --git a/common/mkbp_event.c b/common/mkbp_event.c index 6848bd2813..616f489df6 100644 --- a/common/mkbp_event.c +++ b/common/mkbp_event.c @@ -54,8 +54,10 @@ static inline int host_is_sleeping(void) int is_sleeping = !chipset_in_state(CHIPSET_STATE_ON); #ifdef CONFIG_POWER_TRACK_HOST_SLEEP_STATE + enum host_sleep_event sleep_state = power_get_host_sleep_state(); is_sleeping |= - (power_get_host_sleep_state() == HOST_SLEEP_EVENT_S3_SUSPEND); + (sleep_state == HOST_SLEEP_EVENT_S3_SUSPEND || + sleep_state == HOST_SLEEP_EVENT_S3_WAKEABLE_SUSPEND); #endif return is_sleeping; } diff --git a/include/ec_commands.h b/include/ec_commands.h index 811627776f..30427dfafa 100644 --- a/include/ec_commands.h +++ b/include/ec_commands.h @@ -3538,7 +3538,9 @@ enum host_sleep_event { HOST_SLEEP_EVENT_S3_SUSPEND = 1, HOST_SLEEP_EVENT_S3_RESUME = 2, HOST_SLEEP_EVENT_S0IX_SUSPEND = 3, - HOST_SLEEP_EVENT_S0IX_RESUME = 4 + HOST_SLEEP_EVENT_S0IX_RESUME = 4, + /* S3 suspend with additional enabled wake sources */ + HOST_SLEEP_EVENT_S3_WAKEABLE_SUSPEND = 5, }; struct __ec_align1 ec_params_host_sleep_event { diff --git a/util/ectool.c b/util/ectool.c index e843fc7308..b846f45957 100644 --- a/util/ectool.c +++ b/util/ectool.c @@ -409,13 +409,16 @@ int cmd_hostsleepstate(int argc, char *argv[]) struct ec_params_host_sleep_event p; if (argc < 2) { - fprintf(stderr, "Usage: %s [suspend|resume|freeze|thaw]\n", + fprintf(stderr, "Usage: %s " + "[suspend|wsuspend|resume|freeze|thaw]\n", argv[0]); return -1; } if (!strcmp(argv[1], "suspend")) p.sleep_event = HOST_SLEEP_EVENT_S3_SUSPEND; + else if (!strcmp(argv[1], "wsuspend")) + p.sleep_event = HOST_SLEEP_EVENT_S3_WAKEABLE_SUSPEND; else if (!strcmp(argv[1], "resume")) p.sleep_event = HOST_SLEEP_EVENT_S3_RESUME; else if (!strcmp(argv[1], "freeze")) |