diff options
author | Bruce <Bruce.Wan@quantatw.com> | 2017-02-17 15:30:34 +0800 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2017-02-22 06:46:40 +0000 |
commit | f2c85cc155805ec4a100a550078b9d8a2d591bb5 (patch) | |
tree | 581fd8180ed1af522160f12fe3d5c0cf78f6871b | |
parent | 063660f4eec872f24e71d76285f56788a5aa66dc (diff) | |
download | chrome-ec-f2c85cc155805ec4a100a550078b9d8a2d591bb5.tar.gz |
snappy: add ANX74XX low power mode for different DRP state
Follow reef setting.
BUG=none
BRANCH=reef
TEST=make buildall
Change-Id: I94ee7ddc9a698e03d0f0b2872beee95cc836a7ae
Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/444585
Commit-Ready: Chen Wisley <wisley.chen@quantatw.com>
Tested-by: Bruce Wan <Bruce.Wan@quantatw.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
(cherry picked from commit 4b7e8774d88eccab4713d8fb3c1b12f81ab8b623)
Reviewed-on: https://chromium-review.googlesource.com/446137
Commit-Queue: Chen Wisley <wisley.chen@quantatw.com>
-rw-r--r-- | board/snappy/board.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/board/snappy/board.c b/board/snappy/board.c index eca38f271b..234bb4cb7e 100644 --- a/board/snappy/board.c +++ b/board/snappy/board.c @@ -81,9 +81,18 @@ static void tcpc_alert_event(enum gpio_signal signal) #ifdef CONFIG_USB_PD_TCPC_LOW_POWER static void anx74xx_cable_det_handler(void) { + int level = gpio_get_level(GPIO_USB_C0_CABLE_DET); + + /* + * Setting the low power is handled by DRP status hence + * handle only the attach event. + */ + if (level) + anx74xx_handle_power_mode(NPCX_I2C_PORT0_0, + ANX74XX_NORMAL_MODE); + /* confirm if cable_det is asserted */ - if (!gpio_get_level(GPIO_USB_C0_CABLE_DET) || - gpio_get_level(GPIO_USB_C0_PD_RST_L)) + if (!level || gpio_get_level(GPIO_USB_C0_PD_RST_L)) return; task_set_event(TASK_ID_PD_C0, PD_EVENT_TCPC_RESET, 0); |