summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Brockus <dbrockus@google.com>2020-09-18 11:48:33 -0600
committerCommit Bot <commit-bot@chromium.org>2020-09-19 00:40:23 +0000
commitf264de460f8e472aa29f8bc269f4d698b85d6cf3 (patch)
treea5971bcc3cddb1e22c8f7951fda8818855ecdba8
parent4cb55a8a12a56a9ad19545541cf604d597b705c4 (diff)
downloadchrome-ec-f264de460f8e472aa29f8bc269f4d698b85d6cf3.tar.gz
tcpmv2: don't call tc_partner_usb_comm if in an alt-mode
BUG=b:168805145 BRANCH=none TEST=Ikling hub unattached power to powered with HDMI attached Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: Ie3bfce1d6159d93df5c646fcfa00e4b7e51eb4b7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2419176 Tested-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org> Auto-Submit: Denis Brockus <dbrockus@chromium.org>
-rw-r--r--common/usbc/usb_pe_drp_sm.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/common/usbc/usb_pe_drp_sm.c b/common/usbc/usb_pe_drp_sm.c
index b1aaf72c20..47341a2b82 100644
--- a/common/usbc/usb_pe_drp_sm.c
+++ b/common/usbc/usb_pe_drp_sm.c
@@ -1411,10 +1411,13 @@ static void pe_update_pdo_flags(int port, uint32_t pdo)
else
tc_partner_unconstrainedpower(port, 0);
- if (pdo & PDO_FIXED_COMM_CAP)
- tc_partner_usb_comm(port, 1);
- else
- tc_partner_usb_comm(port, 0);
+ /* Do not set USB comm if we are in an alt-mode */
+ if (pe[port].partner_amodes[TCPC_TX_SOP].amode_idx == 0) {
+ if (pdo & PDO_FIXED_COMM_CAP)
+ tc_partner_usb_comm(port, 1);
+ else
+ tc_partner_usb_comm(port, 0);
+ }
if (pdo & PDO_FIXED_DATA_SWAP)
tc_partner_dr_data(port, 1);