diff options
author | Ayushee <ayushee.shah@intel.com> | 2020-01-14 18:08:15 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-01-31 20:57:57 +0000 |
commit | 42ca68d3cdf74193dd041d336b698bfe3ae1221a (patch) | |
tree | e6375405bf02fff7dbd65827b543fdcbaf5870bc /include | |
parent | a0d6b40c49c7615cddded5e6811a550468eba7b2 (diff) | |
download | chrome-ec-42ca68d3cdf74193dd041d336b698bfe3ae1221a.tar.gz |
TCPMv1: Add support for Thunderbolt active cables
For entering into Thunderbolt-Compatible mode with active
cable, the port sends Enter mode command for SOP', SOP''
(if the cable has a SOP'' controller) and SOP respectively.
If the port doesn't receive GoodCRC from Enter Mode SOP'',
the port resets the cable characteristic and exits the
Thunderbolt-Compatible mode discovery.
This CL enables SOP'' communication with the cable plug
and adds support to enter into Thunderbolt-compatible mode
with active cables.
BUG=b:140643923
BRANCH=None
TEST=Able to enter into Thunderbolt-Compatible mode for
active cables.
Change-Id: Iea0c652043933047e0158265c911775d4afe5758
Signed-off-by: Ayushee <ayushee.shah@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2001938
Reviewed-by: Diana Z <dzigterman@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/usb_pd.h | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/include/usb_pd.h b/include/usb_pd.h index 8ce6335b7d..812dc98e3d 100644 --- a/include/usb_pd.h +++ b/include/usb_pd.h @@ -1184,12 +1184,15 @@ enum cable_outlet { */ #define PD_HEADER_GET_SOP(header) (((header) >> 28) & 0xf) #define PD_HEADER_SOP(sop) ((sop) << 28) -#define PD_MSG_SOP 0 -#define PD_MSG_SOPP 1 -#define PD_MSG_SOPPP 2 -#define PD_MSG_SOP_DBGP 3 -#define PD_MSG_SOP_DBGPP 4 -#define PD_MSG_SOP_CBL_RST 5 + +enum pd_msg_type { + PD_MSG_SOP, + PD_MSG_SOP_PRIME, + PD_MSG_SOP_PRIME_PRIME, + PD_MSG_SOP_DBG_PRIME, + PD_MSG_SOP_DBG_PRIME_PRIME, + PD_MSG_SOP_CBL_RST, +}; /* Used for processing pd extended header */ #define PD_EXT_HEADER_CHUNKED(header) (((header) >> 15) & 1) @@ -1697,7 +1700,7 @@ struct svdm_amode_data *pd_get_amode_data(int port, uint16_t svid); int cable_consume_repeat_message(int port, uint8_t msg_id); /** - * Returns status of CABLE_FLAGS_SOP_PRIME_ENABLE flag + * Returns the status of cable flag - CABLE_FLAGS_SOP_PRIME_ENABLE * * @param port USB-C port number * @return Status of CABLE_FLAGS_SOP_PRIME_ENABLE flag @@ -1705,18 +1708,15 @@ int cable_consume_repeat_message(int port, uint8_t msg_id); bool is_transmit_msg_sop_prime(int port); /** - * Returns the status of cable flag - CABLE_FLAGS_SOP_PRIME_ENABLE + * Returns the type of communication (SOP/SOP'/SOP'') * * @param port USB-C port number * @param data_role current data role * @param pd_flags current pd flags - * @return For rev3.0, true if vconn is on - * For rev2.0, true if vconn is on and data_role is dfp - * False otherwise + * @return Type of message to be transmitted */ -uint8_t is_sop_prime_ready(int port, - enum pd_data_role data_role, - uint32_t pd_flags); +enum pd_msg_type pd_msg_tx_type(int port, enum pd_data_role data_role, + uint32_t pd_flags); /** * Reset Cable type, Cable attributes and cable flags |