summaryrefslogtreecommitdiff
path: root/include/usb_pd_tcpm.h
diff options
context:
space:
mode:
authorAbe Levkoy <alevkoy@chromium.org>2021-08-18 11:43:25 -0600
committerCommit Bot <commit-bot@chromium.org>2021-08-18 23:04:51 +0000
commit59e395027ab03c0ca2b5263193b30dff1c063c44 (patch)
tree7965d55bbc96f1515bdd2ca063fe5d48b69f1bd4 /include/usb_pd_tcpm.h
parentfb89306a92228081e4203a33725357dd9754b6c8 (diff)
downloadchrome-ec-59e395027ab03c0ca2b5263193b30dff1c063c44.tar.gz
TCPM: Rename enum tcpm_transmit_type
Rename tcpm_transmit_type to tcpm_sop_type to reflect that it can be used for Rx as well. Describe it in comments. This prepares to consolidate enum pd_msg_type into this enum. BUG=b:155476419 TEST=make buildall BRANCH=none Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: Ife97d4ad51c48f2e832b94e007954919e236a309 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3104290 Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'include/usb_pd_tcpm.h')
-rw-r--r--include/usb_pd_tcpm.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/include/usb_pd_tcpm.h b/include/usb_pd_tcpm.h
index 0902d411b5..7dfa2dca1c 100644
--- a/include/usb_pd_tcpm.h
+++ b/include/usb_pd_tcpm.h
@@ -65,14 +65,21 @@ static inline enum tcpc_cc_polarity polarity_rm_dts(
return (enum tcpc_cc_polarity)(polarity & BIT(0));
}
-enum tcpm_transmit_type {
+/*
+ * Types of PD data that can be sent or received. The values match the TCPCI bit
+ * field values TRANSMIT[Transmit SOP* Message] (TCPCI r2.0 v1.2, table 4-38)
+ * and RX_BUF_FRAME_TYPE[Received SOP* message] (table 4-37).
+ */
+enum tcpm_sop_type {
TCPC_TX_SOP = 0,
TCPC_TX_SOP_PRIME = 1,
TCPC_TX_SOP_PRIME_PRIME = 2,
TCPC_TX_SOP_DEBUG_PRIME = 3,
TCPC_TX_SOP_DEBUG_PRIME_PRIME = 4,
+ /* Only a valid register setting for TRANSMIT */
TCPC_TX_HARD_RESET = 5,
TCPC_TX_CABLE_RESET = 6,
+ /* Only a valid register setting for TRANSMIT */
TCPC_TX_BIST_MODE_2 = 7,
TCPC_TX_INVALID = 0xf,
};
@@ -302,7 +309,7 @@ struct tcpm_drv {
*
* @return EC_SUCCESS or error
*/
- int (*transmit)(int port, enum tcpm_transmit_type type, uint16_t header,
+ int (*transmit)(int port, enum tcpm_sop_type type, uint16_t header,
const uint32_t *data);
/**