diff options
author | Wai-Hong Tam <waihong@google.com> | 2018-12-10 13:32:45 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-12-12 17:04:47 -0800 |
commit | 55a1ab3f610c65c081a5a39cc21be1699452d6db (patch) | |
tree | 02fdbce03d1a45b9040506cd89b3347d7b8d485e /board/cheza | |
parent | 7d03d8557bb3d99ff741478e4417c35a4ca8b8f7 (diff) | |
download | chrome-ec-55a1ab3f610c65c081a5a39cc21be1699452d6db.tar.gz |
cheza: Disable pull-up on USB_C1_OC_ODL in S5
In S5, we disable the 5V, so the overcurrent detection is not needed.
Disabling its pull-up prevents any current leak.
BRANCH=none
BUG=b:118342484
TEST=Checked the GPIO flag in S0 and S5. Can't verify on real hardware
due to the wrong GPIO pin.
Change-Id: Ib9a0c7abdc7bae820cbfa92f9c7a7e704079e077
Signed-off-by: Wai-Hong Tam <waihong@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1370891
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Diffstat (limited to 'board/cheza')
-rw-r--r-- | board/cheza/board.c | 17 | ||||
-rw-r--r-- | board/cheza/gpio.inc | 2 |
2 files changed, 18 insertions, 1 deletions
diff --git a/board/cheza/board.c b/board/cheza/board.c index 8570349f77..d533f296c3 100644 --- a/board/cheza/board.c +++ b/board/cheza/board.c @@ -395,6 +395,7 @@ void board_tcpc_init(void) } DECLARE_HOOK(HOOK_INIT, board_tcpc_init, HOOK_PRIO_INIT_I2C+1); +/* Called on AP S0 -> S3 transition */ static void board_chipset_suspend(void) { /* @@ -405,6 +406,7 @@ static void board_chipset_suspend(void) } DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, board_chipset_suspend, HOOK_PRIO_DEFAULT); +/* Called on AP S3 -> S0 transition */ static void board_chipset_resume(void) { /* Turn on display backlight in S0. */ @@ -412,6 +414,21 @@ static void board_chipset_resume(void) } DECLARE_HOOK(HOOK_CHIPSET_RESUME, board_chipset_resume, HOOK_PRIO_DEFAULT); +/* Called on AP S5 -> S3 transition */ +static void board_chipset_startup(void) +{ + gpio_set_flags(GPIO_USB_C1_OC_ODL, GPIO_INPUT | GPIO_PULL_UP); +} +DECLARE_HOOK(HOOK_CHIPSET_STARTUP, board_chipset_startup, HOOK_PRIO_DEFAULT); + +/* Called on AP S3 -> S5 transition */ +static void board_chipset_shutdown(void) +{ + /* 5V is off in S5. Disable pull-up to prevent current leak. */ + gpio_set_flags(GPIO_USB_C1_OC_ODL, GPIO_INPUT); +} +DECLARE_HOOK(HOOK_CHIPSET_SHUTDOWN, board_chipset_shutdown, HOOK_PRIO_DEFAULT); + /** * Power on (or off) a single TCPC. * minimum on/off delays are included. diff --git a/board/cheza/gpio.inc b/board/cheza/gpio.inc index 72cd70ab0f..6d128e4684 100644 --- a/board/cheza/gpio.inc +++ b/board/cheza/gpio.inc @@ -122,7 +122,7 @@ GPIO(USBC_MUX_CONF1, PIN(5, 1), GPIO_OUT_HIGH) /* Port-1 enable DP switc /* USB-C port-1 interrupts */ GPIO(USB_C1_DP_HPD, PIN(9, 6), GPIO_INPUT) /* DP HPD from port-1 TCPC */ -GPIO(USB_C1_OC_ODL, PIN(D, 7), GPIO_INPUT | GPIO_PULL_UP) /* Port-1 power switch over-current */ +GPIO(USB_C1_OC_ODL, PIN(D, 7), GPIO_INPUT) /* Port-1 power switch over-current */ /* I2C */ GPIO(I2C0_SCL, PIN(B, 5), GPIO_INPUT) /* EC_I2C_POWER_SCL */ |