diff options
author | Yilun Lin <yllin@chromium.org> | 2019-11-21 11:31:01 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-12-10 10:40:27 +0000 |
commit | 313faa4a8c4d4349f6a8857ad7ceb2421a630dfa (patch) | |
tree | ea3776477b20732e937fe8e82804121f5976551e /board/jacuzzi | |
parent | 73d1e0310aa3f13ea20bd3eb2a695ecfc26735d3 (diff) | |
download | chrome-ec-313faa4a8c4d4349f6a8857ad7ceb2421a630dfa.tar.gz |
power/mt8183: correct EN_PP1800_S5_L enable timing
The power rail should be turned on at G3S5 rather than S5S3,
and should be turned off after stay in G3 for 20ms.
TEST=Ensure the power rail is on/off at correct timing
BUG=b:144144075 b:145255107
BRANCH=none
Change-Id: Ie621ab1ac5332da6718201c44266f41aafcac296
Signed-off-by: Yilun Lin <yllin@chromium.org>
Signed-off-by: Eric Yilun Lin <yllin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1928413
Reviewed-by: Ting Shen <phoenixshen@chromium.org>
Reviewed-by: Alexandru M Stan <amstan@chromium.org>
Diffstat (limited to 'board/jacuzzi')
-rw-r--r-- | board/jacuzzi/board.c | 29 | ||||
-rw-r--r-- | board/jacuzzi/board.h | 5 | ||||
-rw-r--r-- | board/jacuzzi/gpio.inc | 8 |
3 files changed, 12 insertions, 30 deletions
diff --git a/board/jacuzzi/board.c b/board/jacuzzi/board.c index f0cb4d9ddf..ec03ec7c5f 100644 --- a/board/jacuzzi/board.c +++ b/board/jacuzzi/board.c @@ -273,42 +273,13 @@ static void board_chipset_startup(void) } DECLARE_HOOK(HOOK_CHIPSET_STARTUP, board_chipset_startup, HOOK_PRIO_DEFAULT); -static void disable_pp1800_s5_deferred(void); -DECLARE_DEFERRED(disable_pp1800_s5_deferred); - -static void disable_pp1800_s5_deferred(void) -{ - if (power_get_state() == POWER_G3) - gpio_set_level(GPIO_EN_PP1800_S5_L, 1); - else if (power_get_state() == POWER_S5G3 || - power_get_state() == POWER_S3S5 || - power_get_state() == POWER_S5) - /* pmic is still on, wait a few seconds and try again */ - hook_call_deferred(&disable_pp1800_s5_deferred_data, - SECOND); -} - /* Called on AP S3 -> S5 transition */ static void board_chipset_shutdown(void) { gpio_set_level(GPIO_EN_USBA_5V, 0); - if (board_get_version() >= 1) - /* - * use deferred to make sure pp1800_s5 is turned off after pmic - * off. - */ - hook_call_deferred(&disable_pp1800_s5_deferred_data, - SECOND); } DECLARE_HOOK(HOOK_CHIPSET_SHUTDOWN, board_chipset_shutdown, HOOK_PRIO_DEFAULT); -void board_chipset_pre_init(void) -{ - if (board_get_version() >= 1) - gpio_set_level(GPIO_EN_PP1800_S5_L, 0); -} -DECLARE_HOOK(HOOK_CHIPSET_PRE_INIT, board_chipset_pre_init, HOOK_PRIO_DEFAULT); - int board_get_charger_i2c(void) { /* TODO(b:138415463): confirm the bus allocation for future builds */ diff --git a/board/jacuzzi/board.h b/board/jacuzzi/board.h index d964c8e576..e9bf5b8a79 100644 --- a/board/jacuzzi/board.h +++ b/board/jacuzzi/board.h @@ -17,6 +17,11 @@ #include "baseboard.h" +#ifdef BOARD_JUNIPER +#undef CONFIG_CHIPSET_POWER_SEQ_VERSION +#define CONFIG_CHIPSET_POWER_SEQ_VERSION 1 +#endif + /* TODO(b:135086465) led implementation */ #undef CONFIG_LED_COMMON diff --git a/board/jacuzzi/gpio.inc b/board/jacuzzi/gpio.inc index 10957c5328..fed96eda51 100644 --- a/board/jacuzzi/gpio.inc +++ b/board/jacuzzi/gpio.inc @@ -77,9 +77,15 @@ GPIO(EC_INT_L, PIN(C, 7), GPIO_ODR_HIGH) /* EC_AP_INT_ODL */ GPIO(EC_BOARD_ID_EN_L, PIN(C, 15), GPIO_ODR_HIGH) /* EC_BOARD_ID_EN_ODL */ GPIO(USB_C0_HPD_OD, PIN(F, 1), GPIO_ODR_LOW) GPIO(BOOTBLOCK_EN_L, PIN(C, 1), GPIO_ODR_HIGH) -GPIO(EN_PP1800_S5_L, PIN(A, 14), GPIO_OUT_HIGH) GPIO(USB_C0_DISCHARGE, PIN(B, 6), GPIO_OUT_LOW) +#ifdef BOARD_JACUZZI +GPIO(LID_ACCEL_INT_ODL, PIN(A, 14), GPIO_INPUT) +/* Jacuzzi doesn't have EN_PP1800_S5_L. */ +UNIMPLEMENTED(EN_PP1800_S5_L) +#else +GPIO(EN_PP1800_S5_L, PIN(A, 14), GPIO_OUT_LOW) +#endif /* * TODO(b:138352732): On IT88801 expander, To be readded once IT8801 driver and * gpio expander framework has landed. |