summaryrefslogtreecommitdiff
path: root/common/usb_pd_protocol.c
diff options
context:
space:
mode:
authorShawn Nematbakhsh <shawnn@chromium.org>2015-12-03 12:29:47 -0800
committerchrome-bot <chrome-bot@chromium.org>2015-12-03 18:01:57 -0800
commitd837c80ef2a8c26e281f3dcd4eb42f5c42a0340b (patch)
tree1fce2e89b0fd767383bac57e686b3d9b2b3dba2f /common/usb_pd_protocol.c
parent5de8d35d113dcb2595207d490d55ac0c78ece270 (diff)
downloadchrome-ec-d837c80ef2a8c26e281f3dcd4eb42f5c42a0340b.tar.gz
pd: Fix unwanted resets on single-role power supplies
If we're still in DISCONNECTED or DISCONNECTED_DEBOUNCE state, don't check CC lines to detect a disconnect since CC polarity has not yet been established. BUG=chrome-os-partner:48220 BRANCH=None TEST=Verify PD contact can be negotiated on Snoball with either polarity. Change-Id: Iacde14446c0ff5d2170936b650f56668038f613e Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/315780 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Alec Berg <alecaberg@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'common/usb_pd_protocol.c')
-rw-r--r--common/usb_pd_protocol.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c
index 511c5aba4c..b40ed0e98f 100644
--- a/common/usb_pd_protocol.c
+++ b/common/usb_pd_protocol.c
@@ -2533,9 +2533,11 @@ void pd_task(void)
}
}
- /* Check for disconnection */
+ /* Check for disconnection if we're connected */
+ if (!pd_is_connected(port))
+ continue;
#ifdef CONFIG_USB_PD_DUAL_ROLE
- if (!pd_is_connected(port) || pd_is_power_swapping(port))
+ if (pd_is_power_swapping(port))
continue;
#endif
if (pd[port].power_role == PD_ROLE_SOURCE) {