Revert "poppy/nautilus: Move pmic vr decay enable/disable to suspend/resume hooks"

This reverts commit 1f767e3e91.

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. Verified by adding prints that VR decay enable
happens before SLP_S0# is asserted.

Change-Id: I0353f70c65ebe673b0e1b5ddbae2bb04368308cc
Signed-off-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/771055
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
Furquan Shaikh
2017-11-14 22:52:29 -08:00
committed by chrome-bot
parent 99182e10d3
commit 054c4ea83a
2 changed files with 16 additions and 4 deletions

View File

@@ -625,6 +625,14 @@ static void board_pmic_enable_slp_s0_vr_decay(void)
i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992, 0x38, 0x7a);
}
void power_board_handle_host_sleep_event(enum host_sleep_event state)
{
if (state == HOST_SLEEP_EVENT_S0IX_SUSPEND)
board_pmic_enable_slp_s0_vr_decay();
else if (state == HOST_SLEEP_EVENT_S0IX_RESUME)
board_pmic_disable_slp_s0_vr_decay();
}
static void board_pmic_init(void)
{
if (system_jumped_to_this_image())
@@ -949,7 +957,6 @@ const unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors);
static void board_chipset_resume(void)
{
gpio_set_level(GPIO_ENABLE_BACKLIGHT, 1);
board_pmic_disable_slp_s0_vr_decay();
}
DECLARE_HOOK(HOOK_CHIPSET_RESUME, board_chipset_resume, HOOK_PRIO_DEFAULT);
@@ -957,7 +964,6 @@ DECLARE_HOOK(HOOK_CHIPSET_RESUME, board_chipset_resume, HOOK_PRIO_DEFAULT);
static void board_chipset_suspend(void)
{
gpio_set_level(GPIO_ENABLE_BACKLIGHT, 0);
board_pmic_enable_slp_s0_vr_decay();
}
DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, board_chipset_suspend, HOOK_PRIO_DEFAULT);

View File

@@ -636,6 +636,14 @@ static void board_pmic_enable_slp_s0_vr_decay(void)
i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992, 0x38, 0x7a);
}
void power_board_handle_host_sleep_event(enum host_sleep_event state)
{
if (state == HOST_SLEEP_EVENT_S0IX_SUSPEND)
board_pmic_enable_slp_s0_vr_decay();
else if (state == HOST_SLEEP_EVENT_S0IX_RESUME)
board_pmic_disable_slp_s0_vr_decay();
}
static void board_pmic_init(void)
{
if (system_jumped_to_this_image())
@@ -1019,7 +1027,6 @@ DECLARE_HOOK(HOOK_INIT, board_sensor_init, HOOK_PRIO_DEFAULT);
static void board_chipset_resume(void)
{
gpio_set_level(GPIO_ENABLE_BACKLIGHT, 1);
board_pmic_disable_slp_s0_vr_decay();
}
DECLARE_HOOK(HOOK_CHIPSET_RESUME, board_chipset_resume, HOOK_PRIO_DEFAULT);
@@ -1027,7 +1034,6 @@ DECLARE_HOOK(HOOK_CHIPSET_RESUME, board_chipset_resume, HOOK_PRIO_DEFAULT);
static void board_chipset_suspend(void)
{
gpio_set_level(GPIO_ENABLE_BACKLIGHT, 0);
board_pmic_enable_slp_s0_vr_decay();
}
DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, board_chipset_suspend, HOOK_PRIO_DEFAULT);