summaryrefslogtreecommitdiff
path: root/common/usb_pd_policy.c
diff options
context:
space:
mode:
authorAyushee <ayushee.shah@intel.com>2020-04-24 14:49:45 -0700
committerCommit Bot <commit-bot@chromium.org>2020-04-28 01:23:45 +0000
commit095c317197113838f90e815884fe26eae7818dfa (patch)
tree7d670e5917264a76bc659b1aeba112f9e2655786 /common/usb_pd_policy.c
parent64fa1645aae189d0f0bfb2802ee2f6c6fc092318 (diff)
downloadchrome-ec-095c317197113838f90e815884fe26eae7818dfa.tar.gz
USB4: Correct getting product type from VDO
Earlier, the product type was extracted from the Product VDO. But, according to USB PD Spec 3.0 version 2.0 and USB PD spec 2.0 version 1.3 ID Header VDO gives the UFP product type. Also added a check to ensure the port receives a valid UFP product VDO. BUG=b:154900425 BRANCH=None TEST=Checked on Volteer, able to enter into USB4 mode Signed-off-by: Ayushee <ayushee.shah@intel.com> Change-Id: I2efa6885701684df4a39d12c064f8bb658efb8a0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2166484 Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'common/usb_pd_policy.c')
-rw-r--r--common/usb_pd_policy.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/common/usb_pd_policy.c b/common/usb_pd_policy.c
index 1230d96761..af8e9ebf50 100644
--- a/common/usb_pd_policy.c
+++ b/common/usb_pd_policy.c
@@ -545,13 +545,9 @@ static bool is_cable_ready_to_enter_usb4(int port, int cnt)
static bool is_usb4_vdo(int port, int cnt, uint32_t *payload)
{
- enum idh_ptype ptype = PD_IDH_PTYPE(payload[VDO_I(PRODUCT)]);
+ enum idh_ptype ptype = PD_IDH_PTYPE(payload[VDO_I(IDH)]);
- /*
- * Product types Hub and peripheral should use UFP product vdos
- * Reference Table 6-30 USB PD spec 3.2.
- */
- if (ptype == IDH_PTYPE_HUB || ptype == IDH_PTYPE_PERIPH) {
+ if (IS_PD_IDH_UFP_PTYPE(ptype)) {
/*
* Ref: USB Type-C Cable and Connector Specification
* Figure 5-1 USB4 Discovery and Entry Flow Model