summaryrefslogtreecommitdiff
path: root/common/usb_common.c
diff options
context:
space:
mode:
authorVincent Palatin <vpalatin@chromium.org>2021-01-19 12:58:41 +0000
committerCommit Bot <commit-bot@chromium.org>2021-01-25 19:31:38 +0000
commitfbca51787502977287808d0a8d23fa3d480d8cd5 (patch)
treedf6eab0a77d9d0fe410c8e0504a88c27a2ebd7e9 /common/usb_common.c
parentc6baaa7c8201decf21362d55973c7176d300df95 (diff)
downloadchrome-ec-fbca51787502977287808d0a8d23fa3d480d8cd5.tar.gz
pd: fix superspeed mux steering on UFP
When the device has a USB superspeed UFP (which is uncommon, this is either servo v4.1 or a laptop port in SS device-mode), if we connect as a sink *before* trying PD communication, we should connect the SS mux without waiting for the partner PD comm capability as we might never be able to communicate with it over PD. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=b:150614702 BRANCH=servo TEST=use the sink mode enabled by 'cc pdsnk', connect to a USB-C Chromebook, try both video output on USB-C->mini-DP and USB 3.0. Change-Id: Iea0409fce2cb7aca089814ae406a7c05848dd8e4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2637647 Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'common/usb_common.c')
-rw-r--r--common/usb_common.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/common/usb_common.c b/common/usb_common.c
index 37cd0886bd..81e9d2f24f 100644
--- a/common/usb_common.c
+++ b/common/usb_common.c
@@ -430,11 +430,12 @@ mux_state_t get_mux_mode_to_set(int port)
return USB_PD_MUX_NONE;
/*
- * If the power role is sink and the partner device is not capable
+ * If the power role is sink and the PD partner device is not capable
* of USB communication then disconnect.
*/
if (IS_ENABLED(CONFIG_USB_PD_DUAL_ROLE) &&
pd_get_power_role(port) == PD_ROLE_SINK &&
+ pd_capable(port) &&
!pd_get_partner_usb_comm_capable(port))
return USB_PD_MUX_NONE;