summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJett Rink <jettrink@chromium.org>2018-02-23 12:28:24 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-02-27 14:51:13 -0800
commit284c0c35893ff40a2023d52f58670d3b92172a59 (patch)
treee6ac1e091e1424970165ab33512a245a468964dd
parent87c549aebdad39902e110b39c6f7b391c4be7ce8 (diff)
downloadchrome-ec-284c0c35893ff40a2023d52f58670d3b92172a59.tar.gz
usb-pd: Tell TCPC and PPC to both source Vconn
BRANCH=none BUG=b:72961003,b:72956593 TEST=verified with grunt that parade TCPC will no longer shut down when PPC sources Vconn Change-Id: I6c1cee4dd8a40a992813841ec227a6af04de5313 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/935301
-rw-r--r--common/usb_pd_protocol.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c
index 89885c3e84..12b1546217 100644
--- a/common/usb_pd_protocol.c
+++ b/common/usb_pd_protocol.c
@@ -329,15 +329,17 @@ static void set_polarity(int port, int polarity)
#ifdef CONFIG_USBC_VCONN
static void set_vconn(int port, int enable)
{
-#ifdef CONFIG_USBC_PPC
/*
- * USB-C PPCs can source their own Vconn. No need to tell the TCPC
- * to source its own.
+ * 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
+ * potentially source Vconn, but that should be okay since Vconn has
+ * "make before break" electrical requirements when swapping anyway.
*/
- ppc_set_vconn(port, enable);
-#else /* !defined(CONFIG_USBC_PPC) */
tcpm_set_vconn(port, enable);
-#endif /* defined(CONFIG_USBC_PPC) */
+#ifdef CONFIG_USBC_PPC
+ ppc_set_vconn(port, enable);
+#endif
}
#endif /* defined(CONFIG_USBC_VCONN) */