diff options
author | Diana Z <dzigterman@chromium.org> | 2020-09-22 16:57:03 -0600 |
---|---|---|
committer | Justin TerAvest <teravest@chromium.org> | 2020-10-01 23:04:47 +0000 |
commit | 8b05bdfc38ccc2b1eb694ad4d41096e08a5116c4 (patch) | |
tree | 243ed41da6da51bed4b650049a185536f0dd5243 /include/usb_pd_tcpm.h | |
parent | 9b4f53e42e7bfcb2d045eca422b0097cc309a8d2 (diff) | |
download | chrome-ec-8b05bdfc38ccc2b1eb694ad4d41096e08a5116c4.tar.gz |
TCPMv2: Add VBUS_REMOVED level
For boards which use Vbus ADCs, add a VBUS_REMOVED check level. The
level for VBUS_PRESENT should be used in any locations looking for
"Vbus is present" on transition, but in order to correctly detect
disconnection with a load on Vbus, VBUS_REMOVED (vSinkDisconnect)
is required. TODO statements have been added for places where work
will be needed to support vSinkDisconnectPD in the future.
For boards detecting Vbus through an external chip, the levels will
likely be indistinguishable due to the chips setting a lower threshold
for disconnect than for connection.
Unit test code has also been added to encourage new Vbus levels to be
added to the mock, and remind developers to update all locations using
the vbus_level enum.
BRANCH=None
BUG=b:168831161
TEST=make -j buildall
Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: I04014ce54ec162dd9c62f545126d921c6d880741
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2436580
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Diffstat (limited to 'include/usb_pd_tcpm.h')
-rw-r--r-- | include/usb_pd_tcpm.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/include/usb_pd_tcpm.h b/include/usb_pd_tcpm.h index d6f89553fc..9044942171 100644 --- a/include/usb_pd_tcpm.h +++ b/include/usb_pd_tcpm.h @@ -104,10 +104,15 @@ enum tcpc_transmit_complete { TCPC_TX_COMPLETE_FAILED = 2, }; -/* USB-C PD Vbus levels */ +/* + * USB-C PD Vbus levels + * + * Return true on Vbus check if Vbus is... + */ enum vbus_level { - VBUS_SAFE0V, - VBUS_PRESENT, + VBUS_SAFE0V, /* less than vSafe0V max */ + VBUS_PRESENT, /* at least vSafe5V min */ + VBUS_REMOVED, /* less than vSinkDisconnect max */ }; /** |