diff options
Diffstat (limited to 'common/usbc/usb_tc_drp_acc_trysrc_sm.c')
-rw-r--r-- | common/usbc/usb_tc_drp_acc_trysrc_sm.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/common/usbc/usb_tc_drp_acc_trysrc_sm.c b/common/usbc/usb_tc_drp_acc_trysrc_sm.c index 7491250088..a72b99a155 100644 --- a/common/usbc/usb_tc_drp_acc_trysrc_sm.c +++ b/common/usbc/usb_tc_drp_acc_trysrc_sm.c @@ -1508,6 +1508,13 @@ static void set_vconn(int port, int enable) TC_CLR_FLAG(port, TC_FLAGS_VCONN_ON); /* + * Disable PPC Vconn first then TCPC in case the voltage feeds back + * to TCPC and damages. + */ + if (IS_ENABLED(CONFIG_USBC_PPC_VCONN) && !enable) + ppc_set_vconn(port, 0); + + /* * We always need to tell the TCPC to enable Vconn first, otherwise some * TCPCs get confused and think the CC line is in over voltage mode and * immediately disconnects. If there is a PPC, both devices will @@ -1516,8 +1523,8 @@ static void set_vconn(int port, int enable) */ tcpm_set_vconn(port, enable); - if (IS_ENABLED(CONFIG_USBC_PPC_VCONN)) - ppc_set_vconn(port, enable); + if (IS_ENABLED(CONFIG_USBC_PPC_VCONN) && enable) + ppc_set_vconn(port, 1); } /* This must only be called from the PD task */ |