diff options
author | Diana Z <dzigterman@chromium.org> | 2022-08-26 13:31:11 -0600 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-08-27 01:59:30 +0000 |
commit | 24481bb43324532d4bf2e1494a680a071ef9c50d (patch) | |
tree | 95c377367db88900516ec9cf8ab4948b346cc752 /include | |
parent | 872f0f611de625b150e381213ca82e0d89175844 (diff) | |
download | chrome-ec-24481bb43324532d4bf2e1494a680a071ef9c50d.tar.gz |
USB PD: Add macro for passive cable VDO
Add a macro to generate passive cable VDOs and exactly enough enums to
cover fields which have 0 as a reserved value.
BRANCH=None
BUG=b:243151272
TEST=zmake buildall
Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: Ieff7eb9e9fa585d13b54d4c1c183467df5fc20b4
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3859562
Commit-Queue: Abe Levkoy <alevkoy@chromium.org>
Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/usb_pd_vdo.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/usb_pd_vdo.h b/include/usb_pd_vdo.h index 49e55af199..94ab321361 100644 --- a/include/usb_pd_vdo.h +++ b/include/usb_pd_vdo.h @@ -244,6 +244,19 @@ struct product_vdo { * Table 5-1 Certified Cables Where USB4-compatible Operation is Expected * This table lists the USB-C cables those support USB4 */ +enum usb_rev30_plug { + USB_REV30_TYPE_C = 2, + USB_REV30_CAPTIVE = 3, +}; + +enum usb_rev30_latency { + USB_REV30_LATENCY_1m = 1, + USB_REV30_LATENCY_2m = 2, + USB_REV30_LATENCY_3m = 3, + USB_REV30_LATENCY_4m = 4, + USB_REV30_LATENCY_5m = 5, + USB_REV30_LATENCY_6m = 6, +}; enum usb_rev30_ss { USB_R30_SS_U2_ONLY, @@ -282,6 +295,11 @@ union passive_cable_vdo_rev30 { uint32_t raw_value; }; +/* Macro passive VDO generator */ +#define VDO_REV30_PASSIVE(ss, vbus_cur, latency, plug) \ + ((ss & 0x7) | (vbus_cur & 0x3) << 5 | (latency & 0xf) << 13 | \ + (plug & 0x3) << 18) + /*****************************************************************************/ /* * Table 6-39 Active Cable VDO 1 |