diff options
4 files changed, 17 insertions, 6 deletions
diff --git a/zephyr/shim/include/power_host_sleep.h b/zephyr/shim/include/power_host_sleep.h index e4f24b7d88..cc7fe04847 100644 --- a/zephyr/shim/include/power_host_sleep.h +++ b/zephyr/shim/include/power_host_sleep.h @@ -62,7 +62,6 @@ struct host_sleep_event_context { void ap_power_chipset_handle_host_sleep_event( enum host_sleep_event state, struct host_sleep_event_context *ctx); -enum host_sleep_event power_get_host_sleep_state(void); void power_set_host_sleep_state(enum host_sleep_event state); #endif /* CONFIG_AP_PWRSEQ_HOST_SLEEP */ diff --git a/zephyr/subsys/ap_pwrseq/include/ap_power_host_sleep.h b/zephyr/subsys/ap_pwrseq/include/ap_power_host_sleep.h index d3cbc8c15f..9bee8af826 100644 --- a/zephyr/subsys/ap_pwrseq/include/ap_power_host_sleep.h +++ b/zephyr/subsys/ap_pwrseq/include/ap_power_host_sleep.h @@ -39,6 +39,13 @@ enum ap_power_sleep_type { void ap_power_reset_host_sleep_state(void); /* + * Get current sleep type notified. + * + * @return enum ap_power_sleep_type + */ +enum ap_power_sleep_type ap_power_sleep_get_notify(void); + +/* * Check if the sleep type current power transition indicates is the same * as what is notified. If same, means host sleep event notified by AP * through Host Command and SLP_S0 are consistent. Process diff --git a/zephyr/subsys/ap_pwrseq/power_host_sleep.c b/zephyr/subsys/ap_pwrseq/power_host_sleep.c index 2e7df63c51..ff512fa941 100644 --- a/zephyr/subsys/ap_pwrseq/power_host_sleep.c +++ b/zephyr/subsys/ap_pwrseq/power_host_sleep.c @@ -151,6 +151,11 @@ static void ap_power_sleep_set_notify(enum ap_power_sleep_type new_state) sleep_state = new_state; } +enum ap_power_sleep_type ap_power_sleep_get_notify(void) +{ + return sleep_state; +} + void ap_power_sleep_notify_transition(enum ap_power_sleep_type check_state) { if (sleep_state != check_state) diff --git a/zephyr/subsys/ap_pwrseq/x86_non_dsx_common_pwrseq_sm_handler.c b/zephyr/subsys/ap_pwrseq/x86_non_dsx_common_pwrseq_sm_handler.c index a54de0a81d..d57ea0cf20 100644 --- a/zephyr/subsys/ap_pwrseq/x86_non_dsx_common_pwrseq_sm_handler.c +++ b/zephyr/subsys/ap_pwrseq/x86_non_dsx_common_pwrseq_sm_handler.c @@ -328,12 +328,12 @@ static int common_pwr_sm_run(int state) * Ignore the SLP_S0 assertions in idle scenario by checking * the host sleep state. */ - } else if (power_get_host_sleep_state() - == HOST_SLEEP_EVENT_S0IX_SUSPEND && - power_signals_on(IN_PCH_SLP_S0)) { - + } else if (ap_power_sleep_get_notify() == + AP_POWER_SLEEP_SUSPEND && + power_signals_on(IN_PCH_SLP_S0)) { return SYS_POWER_STATE_S0S0ix; - } else { + } else if (ap_power_sleep_get_notify() == + AP_POWER_SLEEP_RESUME) { ap_power_sleep_notify_transition(AP_POWER_SLEEP_RESUME); #endif /* CONFIG_AP_PWRSEQ_S0IX */ } |