diff options
author | Sam Hurst <shurst@google.com> | 2021-03-04 14:59:44 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-03-12 20:11:41 +0000 |
commit | 1dee3ef51fb66a139f2dbb98f8b923199366467d (patch) | |
tree | c037057665bb3891645d55e4e67203e661732ef3 /include | |
parent | 1de6b4fbda2bdc60c010c8136bfc02697a3839bb (diff) | |
download | chrome-ec-1dee3ef51fb66a139f2dbb98f8b923199366467d.tar.gz |
TCPMV2: Add explicit setting of VPD VDO CT Current
Add the capablility to explicity set a CTVPDs VDO
current.
BUG=b:165934405
BRANCH=none
TEST=make runtests
Verified that returned VDO from chocodile_vpdmcu was correct.
Signed-off-by: Sam Hurst <shurst@google.com>
Change-Id: I2292024986fa89b228b56678d61d1aef2866c817
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2748427
Tested-by: Sam Hurst <shurst@google.com>
Reviewed-by: Diana Z <dzigterman@chromium.org>
Commit-Queue: Sam Hurst <shurst@google.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/usb_pd_vdo.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/include/usb_pd_vdo.h b/include/usb_pd_vdo.h index 2cb1804a69..ac8e67b73e 100644 --- a/include/usb_pd_vdo.h +++ b/include/usb_pd_vdo.h @@ -526,7 +526,7 @@ union active_cable_vdo2_rev30 { * 0b - 3A capable; * 1b - 5A capable * Charge Through Support bit = 0b: Reserved, Shall be set to zero - * <14:13> : Reserved Shall be set to zero. + * <13> : Reserved Shall be set to zero. * <12:7> : VBUS Impedance * Charge Through Support bit = 1b: * Vbus impedance through the VPD in 2 mΩ increments. @@ -541,12 +541,18 @@ union active_cable_vdo2_rev30 { * 1b – the VPD supports Charge Through * 0b – the VPD does not support Charge Through */ -#define VDO_VPD(hw, fw, vbus, vbusz, gndz, cts) \ +#define VDO_VPD(hw, fw, vbus, ctc, vbusz, gndz, cts) \ (((hw) & 0xf) << 28 | ((fw) & 0xf) << 24 \ | ((vbus) & 0x3) << 15 \ + | ((ctc) & 0x1) << 14 \ | ((vbusz) & 0x3f) << 7 \ | ((gndz) & 0x3f) << 1 | (cts)) +enum vpd_ctc_support { + VPD_CT_CURRENT_3A, + VPD_CT_CURRENT_5A +}; + enum vpd_vbus { VPD_MAX_VBUS_20V, VPD_MAX_VBUS_30V, @@ -560,6 +566,7 @@ enum vpd_cts_support { }; #define VPD_VDO_MAX_VBUS(vdo) (((vdo) >> 15) & 0x3) +#define VPD_VDO_CURRENT(vdo) (((vdo) >> 14) & 1) #define VPD_VDO_VBUS_IMP(vdo) (((vdo) >> 7) & 0x3f) #define VPD_VDO_GND_IMP(vdo) (((vdo) >> 1) & 0x3f) #define VPD_VDO_CTS(vdo) ((vdo) & 1) |