diff options
author | Sam Hurst <shurst@google.com> | 2019-12-11 13:20:14 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-02-05 21:23:52 +0000 |
commit | ec9f5592b4448bf91369a6eedfc16758c6cfb297 (patch) | |
tree | 2cf272133325000a63d2c1b9d1506c06f28abdf0 /include | |
parent | 678b6f1237a83b642de2356a20eee55da85ae38b (diff) | |
download | chrome-ec-ec9f5592b4448bf91369a6eedfc16758c6cfb297.tar.gz |
TCPMv2: Add TypeC functions needed for PD FAFT
Add status and control functions that are accessed
from the pd console which enables the device to work
with PD FAFT.
BUG=chromium:1021235
BRANCH=none
TEST=make -j buildall
Change-Id: I1a33b50646acf0e7036c325eb4cb7a94cc8ec2cd
Signed-off-by: Sam Hurst <shurst@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1962972
Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/usb_tc_sm.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/include/usb_tc_sm.h b/include/usb_tc_sm.h index 322d3b3224..c797318b91 100644 --- a/include/usb_tc_sm.h +++ b/include/usb_tc_sm.h @@ -16,6 +16,12 @@ #define TC_CLR_FLAG(port, flag) atomic_clear(&tc[port].flags, (flag)) #define TC_CHK_FLAG(port, flag) (tc[port].flags & (flag)) +enum try_src_override_t { + TRY_SRC_OVERRIDE_OFF, + TRY_SRC_OVERRIDE_ON, + TRY_SRC_NO_OVERRIDE +}; + /* * Type C supply voltage (mV) * @@ -335,6 +341,47 @@ void tc_start_event_loop(int port); */ void tc_pause_event_loop(int port); +/** + * Allow system to override the control of TrySrc + * + * @param en TRY_SRC_OVERRIDE_OFF - Force TrySrc OFF + * TRY_SRC_OVERRIDE_ON - Force TrySrc ON + * TRY_SRC_NO_OVERRIDE - Allow state machine to control TrySrc + */ +void tc_try_src_override(enum try_src_override_t ov); + +/** + * Get state of try_src_override + * + * @return TRY_SRC_OVERRIDE_OFF - TrySrc is forced OFF + * TRY_SRC_OVERRIDE_ON - TrySrc is forced ON + * TRY_SRC_NO_OVERRIDE - TypeC state machine controls TrySrc + */ +enum try_src_override_t tc_get_try_src_override(void); + +/** + * Returns the name of the current typeC state + * + * @param port USB-C port number + * @return name of current typeC state + */ +const char *tc_get_current_state(int port); + +/** + * Returns the flag mask of the typeC state machine + * + * @param port USB-C port number + * @return flag mask of the typeC state machine + */ +uint32_t tc_get_flags(int port); + +/* + * Prints the rw hash and sysjump image string. + * + * @param port USB-C port number + */ +void tc_print_dev_info(int port); + #ifdef CONFIG_USB_TYPEC_CTVPD /** |