diff options
author | Ayushee <ayushee.shah@intel.com> | 2020-09-11 17:12:07 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-09-18 00:14:21 +0000 |
commit | c370d201003e44f1a4a6a483903bbbe065664ee1 (patch) | |
tree | 6125af657cb2913413e700a6be91701a23343902 | |
parent | 6c269abef398717658bc863dbc874242d86fdb39 (diff) | |
download | chrome-ec-c370d201003e44f1a4a6a483903bbbe065664ee1.tar.gz |
TCPMv2: Correct setting mux state on updating partner's USB comm
When the USB communication capabilities are enabled and if the port
receives partner's USB communication capability again after entering
an alternate mode, mux doesn't need to be updated. Hence, only the
mux with port partner's USB communication capability if it is in
disconnect state
BUG=b:168453520
BRANCH=None
TEST=Able to retain mux's state after entering a mode.
Signed-off-by: Ayushee <ayushee.shah@intel.com>
Change-Id: I26af254b341c9f0c1cdc4369a50e16f9da329faf
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2407014
Reviewed-by: Keith Short <keithshort@chromium.org>
-rw-r--r-- | common/usbc/usb_tc_drp_acc_trysrc_sm.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/common/usbc/usb_tc_drp_acc_trysrc_sm.c b/common/usbc/usb_tc_drp_acc_trysrc_sm.c index 22ad156074..ba550672c8 100644 --- a/common/usbc/usb_tc_drp_acc_trysrc_sm.c +++ b/common/usbc/usb_tc_drp_acc_trysrc_sm.c @@ -767,10 +767,13 @@ void tc_partner_usb_comm(int port, int en) TC_CLR_FLAG(port, TC_FLAGS_PARTNER_USB_COMM); /* - * Update the mux setting according to the port partner's - * USB communication capability. + * If PE disables the USB communication capability, update the mux + * accordingly while, if the PE enables the USB communication + * capability, update the mux only if it is in disconnect state */ - set_usb_mux_with_current_data_role(port); + if (!en || (IS_ENABLED(CONFIG_USBC_SS_MUX) && + usb_mux_get(port) == USB_PD_MUX_NONE)) + set_usb_mux_with_current_data_role(port); } void tc_partner_dr_data(int port, int en) |