summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAyushee Shah <ayushee.shah@intel.com>2021-01-19 12:58:24 -0800
committerCommit Bot <commit-bot@chromium.org>2021-01-19 23:21:39 +0000
commit04c39c214ef44d4e285ee16c75211ee67f3ba494 (patch)
tree5762e25faf42fb6bef9aec7e70a67cde66f91a27
parent91ec9cfb96c2199915925541e49462006eea2f71 (diff)
downloadchrome-ec-04c39c214ef44d4e285ee16c75211ee67f3ba494.tar.gz
TBT: Correct is_rev3_vdo() function
This CL changes is_rev3_vdo() to check the PD revision instead of checking the VDM version. Also renaming is_rev3_vdo() to is_pd_rev3() BUG=None BRANCH=None TEST=Able to enter USB4 and Thunderbolt with PD3.0 cables Signed-off-by: Ayushee Shah <ayushee.shah@intel.com> Change-Id: Ia34e5ff65ccbbfa168721d62ada8ac973353d6f5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2638368 Reviewed-by: Tanu Malhotra <tanu.malhotra@intel.com> Reviewed-by: Keith Short <keithshort@chromium.org>
-rw-r--r--common/usb_pd_alt_mode_dfp.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/common/usb_pd_alt_mode_dfp.c b/common/usb_pd_alt_mode_dfp.c
index 5a7ed7052b..463fabcdc5 100644
--- a/common/usb_pd_alt_mode_dfp.c
+++ b/common/usb_pd_alt_mode_dfp.c
@@ -676,9 +676,9 @@ void notify_sysjump_ready(void)
task_set_event(sysjump_task_waiting, TASK_EVENT_SYSJUMP_READY);
}
-static inline bool is_rev3_vdo(int port, enum tcpm_transmit_type type)
+static inline bool is_pd_rev3(int port, enum tcpm_transmit_type type)
{
- return pd_get_vdo_ver(port, type) == PD_REV30;
+ return pd_get_rev(port, type) == PD_REV30;
}
/*
@@ -735,7 +735,7 @@ bool is_active_cable_element_retimer(int port)
/* Ref: USB PD Spec 2.0 Table 6-29 Active Cable VDO
* Revision 2 Active cables do not have Active element support.
*/
- return is_rev3_vdo(port, TCPC_TX_SOP_PRIME) &&
+ return is_pd_rev3(port, TCPC_TX_SOP_PRIME) &&
disc->identity.idh.product_type == IDH_PTYPE_ACABLE &&
disc->identity.product_t2.a2_rev30.active_elem ==
ACTIVE_RETIMER;
@@ -795,7 +795,7 @@ static bool is_tbt_cable_superspeed(int port)
return false;
if (IS_ENABLED(CONFIG_USB_PD_REV30) &&
- is_rev3_vdo(port, TCPC_TX_SOP_PRIME))
+ is_pd_rev3(port, TCPC_TX_SOP_PRIME))
return disc->identity.product_t1.p_rev30.ss ==
USB_R30_SS_U32_U40_GEN1 ||
disc->identity.product_t1.p_rev30.ss ==
@@ -935,7 +935,7 @@ enum usb_rev30_ss get_usb4_cable_speed(int port)
max_usb4_speed = tbt_speed == TBT_SS_TBT_GEN3 ?
USB_R30_SS_U40_GEN3 : USB_R30_SS_U32_U40_GEN2;
- if (is_rev3_vdo(port, TCPC_TX_SOP_PRIME)) {
+ if (is_pd_rev3(port, TCPC_TX_SOP_PRIME)) {
disc = pd_get_am_discovery(port, TCPC_TX_SOP_PRIME);
return max_usb4_speed < disc->identity.product_t1.p_rev30.ss ?
@@ -965,7 +965,7 @@ uint32_t get_enter_usb_msg_payload(int port)
eudo.cable_speed = get_usb4_cable_speed(port);
if (disc->identity.idh.product_type == IDH_PTYPE_ACABLE) {
- if (is_rev3_vdo(port, TCPC_TX_SOP_PRIME)) {
+ if (is_pd_rev3(port, TCPC_TX_SOP_PRIME)) {
enum retimer_active_element active_element =
disc->identity.product_t2.a2_rev30.active_elem;
eudo.cable_type = active_element == ACTIVE_RETIMER ?