summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJett Rink <jettrink@chromium.org>2018-10-17 11:51:19 -0600
committerchrome-bot <chrome-bot@chromium.org>2018-10-18 19:01:19 -0700
commit2b837df5b8f363c3e224dab794ade7202843e410 (patch)
tree0555bd01fd392a1b155a50f163790a5eb121f0ec
parent505ac2ac64426253938b809627323b24d5072ffd (diff)
downloadchrome-ec-2b837df5b8f363c3e224dab794ade7202843e410.tar.gz
usb-pd: Do not source Vconn in DTS
Normally a PD source also sources Vconn, but when a debug accessory is detected, then it should not source Vconn. See section 4.5.2.2.17.1 in USB-PD spec v1-3 BRANCH=none BUG=b:117182673 TEST=servoV4 set to snkdts now has proper CC values using its adc function Change-Id: Iec0dcb8285b092fd398e600645eec36a0025c00b Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1286294 Reviewed-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Raul E Rangel <rrangel@chromium.org>
-rw-r--r--common/usb_pd_protocol.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c
index d5937eaa29..4dab66f8df 100644
--- a/common/usb_pd_protocol.c
+++ b/common/usb_pd_protocol.c
@@ -2907,11 +2907,19 @@ void pd_task(void *u)
#ifdef CONFIG_USBC_VCONN
/*
- * Start sourcing Vconn before Vbus to ensure
- * we are within USB Type-C Spec 1.3 tVconnON
+ * Do not source Vconn when debug accessory is
+ * detected. Section 4.5.2.2.17.1 in USB spec
+ * v1-3
*/
- set_vconn(port, 1);
- pd[port].flags |= PD_FLAGS_VCONN_ON;
+ if (new_cc_state != PD_CC_DEBUG_ACC) {
+ /*
+ * Start sourcing Vconn before Vbus to
+ * ensure we are within USB Type-C
+ * Spec 1.3 tVconnON.
+ */
+ set_vconn(port, 1);
+ pd[port].flags |= PD_FLAGS_VCONN_ON;
+ }
#endif
#ifndef CONFIG_USBC_BACKWARDS_COMPATIBLE_DFP