summaryrefslogtreecommitdiff
path: root/common
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-27 18:34:20 +0000
commit99feee9047810e75c7beffa962d88956735f8654 (patch)
treedb4582f47db5dd472ac8c8d5d8f688f745cc11c3 /common
parent6ed0a68eadcb0d07ffdcc2c581d2961b49c21f19 (diff)
downloadchrome-ec-99feee9047810e75c7beffa962d88956735f8654.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>
Diffstat (limited to 'common')
-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 d541603568..c630d543da 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;