summaryrefslogtreecommitdiff
path: root/common/usb_pd_dual_role.c
diff options
context:
space:
mode:
authorDiana Z <dzigterman@chromium.org>2021-05-20 21:27:15 -0600
committerCommit Bot <commit-bot@chromium.org>2021-05-21 05:43:27 +0000
commit7173c40fc78aea6797a8bcc402e28b4453ca2f1a (patch)
tree5e7b6a89989f624d4f952f1266ce9e04e4d6ed6d /common/usb_pd_dual_role.c
parent2488b0595fca9f17cd31d61821512017d3536a0b (diff)
downloadchrome-ec-7173c40fc78aea6797a8bcc402e28b4453ca2f1a.tar.gz
USBC: Disallow Try.SRC when not toggling
Chromeboxes may Try.SRC when a dedicated charger is present. However, they should not Try.SRC at a time when they are note dual-role toggling. This likely represents a time when they are unable to source Vbus and should therefore not attempt to become the source. BRANCH=None BUG=b:188710940 TEST=on mancomb, power on with the BJ charger and then connect a dock in G3. Observe we do not attempt to source the dock sans Vbus Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Ia9062f8f833d678b5b3c9daf576dc6ad2f2a8c74 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2912113 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'common/usb_pd_dual_role.c')
-rw-r--r--common/usb_pd_dual_role.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/common/usb_pd_dual_role.c b/common/usb_pd_dual_role.c
index 3c6aff6adf..ae8429262d 100644
--- a/common/usb_pd_dual_role.c
+++ b/common/usb_pd_dual_role.c
@@ -404,9 +404,9 @@ bool pd_is_try_source_capable(void)
#if CONFIG_DEDICATED_CHARGE_PORT_COUNT > 0
/*
* If a dedicated supplier is present, power is not a concern and
- * therefore always allow Try.Src.
+ * therefore allow Try.Src if we're toggling.
*/
- new_try_src |= (charge_manager_get_supplier() ==
+ new_try_src = try_src && (charge_manager_get_supplier() ==
CHARGE_SUPPLIER_DEDICATED);
#endif /* CONFIG_DEDICATED_CHARGE_PORT_COUNT */