summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVijay Hiremath <vijay.p.hiremath@intel.com>2021-04-22 11:20:09 -0700
committerCommit Bot <commit-bot@chromium.org>2021-04-29 17:35:26 +0000
commitf7c8903f40a2f3fac1ccc23e6d8737414f6e5f4d (patch)
treeb8da98ff2450923e7bb2ddc1209edaeadbf86a2e
parent9508d85efd91ec90c02e5b65e1bd507f994f8abe (diff)
downloadchrome-ec-f7c8903f40a2f3fac1ccc23e6d8737414f6e5f4d.tar.gz
TCPMv2: Enter TBT/USB4 only if port supports
Type-C ports may not be symmetrical on Reference Design Platforms hence check if the port supports TBT & USB4 mode before entering the mode. BUG=none BRANCH=none TEST=Tested on ADLRVP, TBT is not entered on non supported port Change-Id: Ifd3eae72f6226686462b07f9008b66bd60c7895b Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2846634 Reviewed-by: Ayushee Shah <ayushee.shah@intel.com> Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2860082 Tested-by: Abe Levkoy <alevkoy@chromium.org> Commit-Queue: Abe Levkoy <alevkoy@chromium.org>
-rw-r--r--common/usbc/usb_pd_dpm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/common/usbc/usb_pd_dpm.c b/common/usbc/usb_pd_dpm.c
index 9aefa97649..1e5137905a 100644
--- a/common/usbc/usb_pd_dpm.c
+++ b/common/usbc/usb_pd_dpm.c
@@ -275,8 +275,9 @@ static void dpm_attempt_mode_entry(int port)
return;
}
- /* Check if the device and cable support USB4. */
+ /* Check if port, port partner and cable support USB4. */
if (IS_ENABLED(CONFIG_USB_PD_USB4) &&
+ board_is_tbt_usb4_port(port) &&
enter_usb_port_partner_is_capable(port) &&
enter_usb_cable_is_capable(port) &&
dpm_mode_entry_requested(port, TYPEC_MODE_USB4)) {
@@ -295,6 +296,7 @@ static void dpm_attempt_mode_entry(int port)
/* If not, check if they support Thunderbolt alt mode. */
if (IS_ENABLED(CONFIG_USB_PD_TBT_COMPAT_MODE) &&
+ board_is_tbt_usb4_port(port) &&
pd_is_mode_discovered_for_svid(port, TCPC_TX_SOP, USB_VID_INTEL) &&
dpm_mode_entry_requested(port, TYPEC_MODE_TBT)) {
enter_mode_requested = true;