summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorJan Dabros <jsd@semihalf.com>2021-08-12 11:38:48 +0200
committerCommit Bot <commit-bot@chromium.org>2021-08-25 17:45:21 +0000
commit3f4dec3720c1d70a3265ee133e1c9154c7d89adf (patch)
tree2471642df959af4badf1432f1784e7e11041eb2d /common
parent7dddeb52f1f4e0d44b99424a7b8c69b38f48b996 (diff)
downloadchrome-ec-3f4dec3720c1d70a3265ee133e1c9154c7d89adf.tar.gz
pd: usb: Add usb type-c USB mux handling for UFP-only platforms
Some platforms (e.g. servo_v4(p1)) are designed to act only as a UFP considering superspeed terminations. Add config option to properly manage usb superspeed muxer for such. BUG=b:137887386,b:182419010 BRANCH=main TEST=With servo_v4p1 connected to the DUT, unplug and replug CHG couple of times in order to force PR_SWAP on DUT port. Each time verify on the DUT console, whether all USB3 devices are visible. They should be, since servo is trying to perform DR_SWAP when it acts as a SRC. Signed-off-by: Jan Dabros <jsd@semihalf.com> Change-Id: I0a7756f0bb2192795b7489334ed01d317d3e54ee Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3094246 Reviewed-by: Michał Barnaś <mb@semihalf.com> Reviewed-by: Wai-Hong Tam <waihong@google.com> Commit-Queue: Wai-Hong Tam <waihong@google.com>
Diffstat (limited to 'common')
-rw-r--r--common/usb_common.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/common/usb_common.c b/common/usb_common.c
index a77771d9e4..97ebedc3d3 100644
--- a/common/usb_common.c
+++ b/common/usb_common.c
@@ -483,6 +483,12 @@ mux_state_t get_mux_mode_to_set(int port)
pd_get_data_role(port) != PD_ROLE_DFP)
return USB_PD_MUX_NONE;
+ /* If new data role isn't UFP & we only support UFP then disconnect. */
+ if (IS_ENABLED(CONFIG_USB_PD_DUAL_ROLE) &&
+ IS_ENABLED(CONFIG_USBC_SS_MUX_UFP_ONLY) &&
+ pd_get_data_role(port) != PD_ROLE_UFP)
+ return USB_PD_MUX_NONE;
+
/*
* If the power role is sink and the PD partner device is not capable
* of USB communication then disconnect.