summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2019-01-15 10:09:34 -0800
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2019-03-11 19:51:51 +0000
commit6e3a5f88cde0698526e0455ad92bfcb8f23993ac (patch)
treed3fb7e131cc96b967126ffc838a7461ec55f24d0 /common
parent6d766c5f591755cdd90c0d910a3ffe1e37871d0e (diff)
downloadchrome-ec-6e3a5f88cde0698526e0455ad92bfcb8f23993ac.tar.gz
USB-PD: Disable Vconn on SRC_DISCONNECT
Currently, source only devices do not turn off Vconn when a partner is disconnected. This causes the polarity detection to be disabled. This patch turns off Vconn on SRC_DISCONNECT for !CONFIG_USB_PD_DUAL_ROLE boards. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=b/122861749 BRANCH=Kalista TEST=Plug in an ethernet dongle via a USB-C-to-A adapter. Replug it upside down and verify Ethernet is turned on on both sides. Change-Id: I4ac303f2121d9e4114ce7097db304e4f65f27ae0 Reviewed-on: https://chromium-review.googlesource.com/1412228 Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Zhuohao Lee <zhuohao@chromium.org> (cherry picked from commit e72e82db71624a1ef02725d384ae06a138585a01) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1515817 Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Diana Z <dzigterman@chromium.org> Tested-by: Diana Z <dzigterman@chromium.org>
Diffstat (limited to 'common')
-rw-r--r--common/usb_pd_protocol.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c
index a4ed713499..9d518a751b 100644
--- a/common/usb_pd_protocol.c
+++ b/common/usb_pd_protocol.c
@@ -683,7 +683,10 @@ static inline void set_state(int port, enum pd_states next_state)
0);
#else /* CONFIG_USB_PD_DUAL_ROLE */
if (next_state == PD_STATE_SRC_DISCONNECTED) {
-#endif
+#ifdef CONFIG_USBC_VCONN
+ set_vconn(port, 0);
+#endif /* CONFIG_USBC_VCONN */
+#endif /* !CONFIG_USB_PD_DUAL_ROLE */
/*
* If we are source, make sure VBUS is off and
* if PD REV3.0, restore RP.