diff options
Diffstat (limited to 'power/common.c')
-rw-r--r-- | power/common.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/power/common.c b/power/common.c index 832e1cc251..c9f58e92db 100644 --- a/power/common.c +++ b/power/common.c @@ -735,6 +735,23 @@ static int host_command_host_sleep_event(struct host_cmd_handler_args *args) const struct ec_params_host_sleep_event *p = args->params; host_sleep_state = p->sleep_event; + +#ifdef CONFIG_POWER_S0IX + if (p->sleep_event == HOST_SLEEP_EVENT_S0IX_SUSPEND) { + CPRINTS("S0ix sus evt"); + task_wake(TASK_ID_CHIPSET); + } else if (p->sleep_event == HOST_SLEEP_EVENT_S0IX_RESUME) { + CPRINTS("S0ix res evt"); + /* + * For all scenarios where lid is not open + * this will be trigerred when other wake + * sources like keyboard, trackpad are used. + */ + if (!chipset_in_state(CHIPSET_STATE_ON)) + task_wake(TASK_ID_CHIPSET); + } +#endif /* CONFIG_POWER_S0IX */ + return EC_RES_SUCCESS; } DECLARE_HOST_COMMAND(EC_CMD_HOST_SLEEP_EVENT, @@ -745,4 +762,12 @@ enum host_sleep_event power_get_host_sleep_state(void) { return host_sleep_state; } + +#ifdef CONFIG_POWER_S0IX +void power_reset_host_sleep_state(enum host_sleep_event sleep_event) +{ + host_sleep_state = sleep_event; +} +#endif /* CONFIG_POWER_S0IX */ + #endif /* CONFIG_POWER_TRACK_HOST_SLEEP_STATE */ |