From 99182e10d3ade88dc560abf8102949d766ec40e5 Mon Sep 17 00:00:00 2001 From: Furquan Shaikh Date: Tue, 14 Nov 2017 22:50:59 -0800 Subject: Revert "power: Get rid of power_board_handle_host_sleep_event" This reverts commit 352276235ca18404a42ca01b75de3fdc7951e271. This is required to ensure that PMIC VR decay is enabled before SLP_S0# is asserted. Else, the setting does not take effect and hence results in higher power consumption. BUG=b:69337192 BRANCH=None TEST=make -j buildall Change-Id: I6885e7447277d853a2414be299dfea25f5547df4 Signed-off-by: Furquan Shaikh Reviewed-on: https://chromium-review.googlesource.com/771054 Reviewed-by: Aaron Durbin --- include/power.h | 8 ++++++++ power/intel_x86.c | 12 +++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/include/power.h b/include/power.h index a39b757078..271b8add69 100644 --- a/include/power.h +++ b/include/power.h @@ -192,6 +192,14 @@ enum host_sleep_event power_get_host_sleep_state(void); */ void power_chipset_handle_host_sleep_event(enum host_sleep_event state); +/** + * Provide callback to allow board to take any action on host sleep event + * command. + * + * @param state Current host sleep state updated by the host. + */ +void power_board_handle_host_sleep_event(enum host_sleep_event state); + /* * This is the default state of host sleep event. Calls to * power_reset_host_sleep_state will set host sleep event to this diff --git a/power/intel_x86.c b/power/intel_x86.c index 46cfb13df8..8a841161e3 100644 --- a/power/intel_x86.c +++ b/power/intel_x86.c @@ -473,10 +473,19 @@ void common_intel_x86_handle_rsmrst(enum power_state state) CPRINTS("Pass through GPIO_RSMRST_L_PGOOD: %d", rsmrst_in); } -#if defined(CONFIG_POWER_TRACK_HOST_SLEEP_STATE) && defined(CONFIG_POWER_S0IX) +#ifdef CONFIG_POWER_TRACK_HOST_SLEEP_STATE + +void __attribute__((weak)) +power_board_handle_host_sleep_event(enum host_sleep_event state) +{ + /* Default weak implementation -- no action required. */ +} void power_chipset_handle_host_sleep_event(enum host_sleep_event state) { + power_board_handle_host_sleep_event(state); + +#ifdef CONFIG_POWER_S0IX if (state == HOST_SLEEP_EVENT_S0IX_SUSPEND) { /* * Indicate to power state machine that a new host event for @@ -499,6 +508,7 @@ void power_chipset_handle_host_sleep_event(enum host_sleep_event state) } else if (state == HOST_SLEEP_EVENT_DEFAULT_RESET) { power_signal_disable_interrupt(sleep_sig[SYS_SLEEP_S0IX]); } +#endif } #endif -- cgit v1.2.1