diff options
author | Furquan Shaikh <furquan@chromium.org> | 2017-11-14 22:52:29 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-11-15 13:23:32 -0800 |
commit | 054c4ea83a5ef2be64b20d9c703c93875083ff58 (patch) | |
tree | 35703d69739b87ba7191e109874685273560499d | |
parent | 99182e10d3ade88dc560abf8102949d766ec40e5 (diff) | |
download | chrome-ec-054c4ea83a5ef2be64b20d9c703c93875083ff58.tar.gz |
Revert "poppy/nautilus: Move pmic vr decay enable/disable to suspend/resume hooks"
This reverts commit 1f767e3e91be388dee689ac85408dfb5e3414581.
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>
-rw-r--r-- | board/nautilus/board.c | 10 | ||||
-rw-r--r-- | board/poppy/board.c | 10 |
2 files changed, 16 insertions, 4 deletions
diff --git a/board/nautilus/board.c b/board/nautilus/board.c index 78f07ef354..c95f1ceab2 100644 --- a/board/nautilus/board.c +++ b/board/nautilus/board.c @@ -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); diff --git a/board/poppy/board.c b/board/poppy/board.c index 58b108bb26..4baf488a85 100644 --- a/board/poppy/board.c +++ b/board/poppy/board.c @@ -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); |