diff options
Diffstat (limited to 'zephyr/subsys/ap_pwrseq/power_host_sleep.c')
-rw-r--r-- | zephyr/subsys/ap_pwrseq/power_host_sleep.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/zephyr/subsys/ap_pwrseq/power_host_sleep.c b/zephyr/subsys/ap_pwrseq/power_host_sleep.c index 5c91b2503e..96335b066b 100644 --- a/zephyr/subsys/ap_pwrseq/power_host_sleep.c +++ b/zephyr/subsys/ap_pwrseq/power_host_sleep.c @@ -25,6 +25,7 @@ LOG_MODULE_DECLARE(ap_pwrseq, CONFIG_AP_PWRSEQ_LOG_LEVEL); * 4. If state is S0ix and no lazy or active wake mask is set, then use default * S0ix mask to be compatible with older BIOS versions. */ +#ifndef CONFIG_AP_PWRSEQ_DRIVER void power_update_wake_mask(void) { host_event_t wake_mask; @@ -44,6 +45,28 @@ void power_update_wake_mask(void) lpc_set_host_event_mask(LPC_HOST_EVENT_WAKE, wake_mask); } +#else +void power_update_wake_mask(void) +{ + const struct device *dev = ap_pwrseq_get_instance(); + host_event_t wake_mask; + enum ap_pwrseq_state state; + + state = ap_pwrseq_get_current_state(dev); + + if (state == AP_POWER_STATE_S0) + wake_mask = 0; + else if (lpc_is_active_wm_set_by_host() || + ap_power_get_lazy_wake_mask(state, &wake_mask)) + return; +#if CONFIG_AP_PWRSEQ_S0IX + if ((state == AP_POWER_STATE_S0IX) && (wake_mask == 0)) + wake_mask = DEFAULT_WAKE_MASK_S0IX; +#endif + + lpc_set_host_event_mask(LPC_HOST_EVENT_WAKE, wake_mask); +} +#endif /* CONFIG_AP_PWRSEQ_DRIVER */ static void power_update_wake_mask_deferred(struct k_work *work) { @@ -251,7 +274,12 @@ void ap_power_chipset_handle_host_sleep_event( power_signal_disable(PWR_SLP_S0); } #endif /* CONFIG_AP_PWRSEQ_S0IX */ + +#ifndef CONFIG_AP_PWRSEQ_DRIVER ap_pwrseq_wake(); +#else + ap_pwrseq_post_event(ap_pwrseq_get_instance(), AP_PWRSEQ_EVENT_HOST); +#endif /* CONFIG_AP_PWRSEQ_DRIVER */ } uint16_t host_get_sleep_timeout(void) |