diff options
-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); |