diff options
author | Ayushee <ayushee.shah@intel.com> | 2020-02-07 15:27:03 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-05-04 22:28:01 +0000 |
commit | 8d2187232e858d5f85501a2afcbb4b1ec1d1b59c (patch) | |
tree | 4f60764300552eac8156240b773fa56159c92834 /include/usb_pd.h | |
parent | 9a6eba9f0f9206318bf711e9f8499ecd532c7077 (diff) | |
download | chrome-ec-8d2187232e858d5f85501a2afcbb4b1ec1d1b59c.tar.gz |
usb_pd: Move Thunderbolt-Compatible functions to common file
Added 'get_tcpm_transmit_msg_type()' to return type of SOP message
transmitted since, 'PD_HEADER_GET_SOP' is not a part of PD spec and
TCPMv1 will return 0 irrespective of type of SOP message transmitted.
BUG=b:148528713
BRANCH=none
TEST=Able to enter Thunderbolt-Compat mode with both Active and Passive
cable on TCPMv1.
Change-Id: Ic53efeda9d9e012571f3047bc2a0d65969296b8c
Signed-off-by: Ayushee <ayushee.shah@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2051630
Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'include/usb_pd.h')
-rw-r--r-- | include/usb_pd.h | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/include/usb_pd.h b/include/usb_pd.h index d5e133bfe0..2ab05ebe2d 100644 --- a/include/usb_pd.h +++ b/include/usb_pd.h @@ -1916,6 +1916,72 @@ enum tbt_compat_cable_speed get_tbt_cable_speed(int port); enum tbt_compat_rounded_support get_tbt_rounded_support(int port); /** + * Sets the Mux state to Thunderbolt-Compatible mode + * + * @param port USB-C port number + */ +void set_tbt_compat_mode_ready(int port); + +/** + * Checks if the attached cable supports superspeed + * + * @param port USB-C port number + * @return True if cable is superspeed, false otherwise + */ +bool is_tbt_cable_superspeed(int port); + +/** + * Check if product supports any Modal Operation (Alternate Modes) + * + * @param port USB-C port number + * @param cnt number of data objects in payload + * @param payload payload data + * @return True if product supports Modal Operation, false otherwise + */ +bool is_modal(int port, int cnt, const uint32_t *payload); + +/** + * Checks all the SVID for USB_VID_INTEL + * + * @param port USB-C port number + * @param prev_svid_cnt Previous SVID count + * @return True is SVID = USB_VID_INTEL, false otherwise + */ +bool is_intel_svid(int port, int prev_svid_cnt); + +/** + * Checks if Device discover mode response contains Thunderbolt alternate mode + * + * @param port USB-C port number + * @param cnt number of data objects in payload + * @param payload payload data + * @return True if Thunderbolt Alternate mode response is received, + * false otherwise + */ +bool is_tbt_compat_mode(int port, int cnt, const uint32_t *payload); + +/* + * Checks if the cable supports Thunderbolt speed. + * + * @param port USB-C port number + * @return True if the Thunderbolt cable speed is TBT_SS_TBT_GEN3 or + * TBT_SS_U32_GEN1_GEN2, false otherwise + */ +bool cable_supports_tbt_speed(int port); + +/** + * Fills the TBT3 objects in the payload and returns the number + * of objects it has filled. + * + * @param port USB-C port number + * @param sop Type of SOP message transmitted (SOP/SOP'/SOP'') + * @param payload payload data + * @return Number of object filled + */ +int enter_tbt_compat_mode(int port, enum tcpm_transmit_type sop, + uint32_t *payload); + +/** * Return maximum allowed speed for Thunderbolt-compatible mode * * NOTE: Chromebooks require that all USB-C ports support the same features, |