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>
This commit is contained in:
Shawn Nematbakhsh
2015-12-03 12:29:47 -08:00
committed by chrome-bot
parent 5de8d35d11
commit d837c80ef2

View File

@@ -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) {