summaryrefslogtreecommitdiff
path: root/include/usb_pd_tcpm.h
diff options
context:
space:
mode:
authorAbe Levkoy <alevkoy@chromium.org>2021-08-27 15:21:39 -0600
committerCommit Bot <commit-bot@chromium.org>2021-08-31 18:18:20 +0000
commit003ec08f8c67845ae8481d3fb4124555213b04c4 (patch)
tree3502c59532731d0003532657b1a2993e8ca9ad81 /include/usb_pd_tcpm.h
parent5fa669005c3779b7310bf6bfe43f741a3d8ae871 (diff)
downloadchrome-ec-003ec08f8c67845ae8481d3fb4124555213b04c4.tar.gz
TCPM: Rename enum tcpm_sop_type and its constants
As a followup to CL:3104290, give the TCPCI TRANSMIT and RX_BUF_FRAME_TYPE types more consistent names. Most of them can be used for receiving, not just transmitting. Fix lint errors thus revealed. BUG=b:155476419 TEST=make buildall BRANCH=none Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: I399ec479eacc18622fc4d3f55f8bdabf4560fcff Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3125995 Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'include/usb_pd_tcpm.h')
-rw-r--r--include/usb_pd_tcpm.h27
1 files changed, 14 insertions, 13 deletions
diff --git a/include/usb_pd_tcpm.h b/include/usb_pd_tcpm.h
index 7dfa2dca1c..08c332efa2 100644
--- a/include/usb_pd_tcpm.h
+++ b/include/usb_pd_tcpm.h
@@ -68,24 +68,25 @@ static inline enum tcpc_cc_polarity polarity_rm_dts(
/*
* 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).
+ * and RX_BUF_FRAME_TYPE[Received SOP* message] (table 4-37). Note that Hard
+ * Reset, Cable Reset, and BIST Carrier Mode 2 are not really messages.
*/
-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,
+enum tcpci_msg_type {
+ TCPCI_MSG_SOP = 0,
+ TCPCI_MSG_SOP_PRIME = 1,
+ TCPCI_MSG_SOP_PRIME_PRIME = 2,
+ TCPCI_MSG_SOP_DEBUG_PRIME = 3,
+ TCPCI_MSG_SOP_DEBUG_PRIME_PRIME = 4,
/* Only a valid register setting for TRANSMIT */
- TCPC_TX_HARD_RESET = 5,
- TCPC_TX_CABLE_RESET = 6,
+ TCPCI_MSG_TX_HARD_RESET = 5,
+ TCPCI_MSG_CABLE_RESET = 6,
/* Only a valid register setting for TRANSMIT */
- TCPC_TX_BIST_MODE_2 = 7,
- TCPC_TX_INVALID = 0xf,
+ TCPCI_MSG_TX_BIST_MODE_2 = 7,
+ TCPCI_MSG_INVALID = 0xf,
};
/* Number of valid Transmit Types */
-#define NUM_SOP_STAR_TYPES (TCPC_TX_SOP_DEBUG_PRIME_PRIME + 1)
+#define NUM_SOP_STAR_TYPES (TCPCI_MSG_SOP_DEBUG_PRIME_PRIME + 1)
enum tcpc_transmit_complete {
TCPC_TX_UNSET = -1,
@@ -309,7 +310,7 @@ struct tcpm_drv {
*
* @return EC_SUCCESS or error
*/
- int (*transmit)(int port, enum tcpm_sop_type type, uint16_t header,
+ int (*transmit)(int port, enum tcpci_msg_type type, uint16_t header,
const uint32_t *data);
/**