mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-28 10:45:22 +00:00
power: Allow host to request higher-power wakeable S3
Allow host to request a higher-power S3 variant, "wakeable S3", in which more wakeup sources will be enabled by the EC. The actual implementation and list of wake sources is left up to the chipset power driver and/or board code. BUG=b:63037490 BRANCH=gru TEST=With subsequent commit, compile on scarlet w/ power sequencing version = 2. Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Change-Id: I469f0cd969052f173cb176196bb6d05f6f76fdb5 Reviewed-on: https://chromium-review.googlesource.com/572210 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Philip Chen <philipchen@chromium.org>
This commit is contained in:
committed by
chrome-bot
parent
5f91536386
commit
2f09d4adea
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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"))
|
||||
|
||||
Reference in New Issue
Block a user