summaryrefslogtreecommitdiff
path: root/common/usb_pd_tcpc.c
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 /common/usb_pd_tcpc.c
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 'common/usb_pd_tcpc.c')
-rw-r--r--common/usb_pd_tcpc.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/common/usb_pd_tcpc.c b/common/usb_pd_tcpc.c
index fd933d655e..1aaee29abc 100644
--- a/common/usb_pd_tcpc.c
+++ b/common/usb_pd_tcpc.c
@@ -259,7 +259,7 @@ static struct pd_port_controller {
int rx_buf_head, rx_buf_tail;
/* Next transmit */
- enum tcpm_sop_type tx_type;
+ enum tcpci_msg_type tx_type;
uint16_t tx_head;
uint32_t tx_payload[7];
const uint32_t *tx_data;
@@ -721,11 +721,11 @@ int pd_analyze_rx(int port, uint32_t *payload)
#ifdef CONFIG_USB_PD_DECODE_SOP
/* Encode message address */
if (val == PD_SOP) {
- phs.head |= PD_HEADER_SOP(TCPC_TX_SOP);
+ phs.head |= PD_HEADER_SOP(TCPCI_MSG_SOP);
} else if (val == PD_SOP_PRIME) {
- phs.head |= PD_HEADER_SOP(TCPC_TX_SOP_PRIME);
+ phs.head |= PD_HEADER_SOP(TCPCI_MSG_SOP_PRIME);
} else if (val == PD_SOP_PRIME_PRIME) {
- phs.head |= PD_HEADER_SOP(TCPC_TX_SOP_PRIME_PRIME);
+ phs.head |= PD_HEADER_SOP(TCPCI_MSG_SOP_PRIME_PRIME);
} else {
msg = "SOP*";
goto packet_err;
@@ -868,19 +868,19 @@ int tcpc_run(int port, int evt)
if ((evt & PD_EVENT_TX) && pd[port].rx_enabled) {
switch (pd[port].tx_type) {
#if defined(CONFIG_USB_VPD) || defined(CONFIG_USB_CTVPD)
- case TCPC_TX_SOP_PRIME:
+ case TCPCI_MSG_SOP_PRIME:
#else
- case TCPC_TX_SOP:
+ case TCPCI_MSG_SOP:
#endif
res = send_validate_message(port,
pd[port].tx_head,
pd[port].tx_data);
break;
- case TCPC_TX_BIST_MODE_2:
+ case TCPCI_MSG_TX_BIST_MODE_2:
bist_mode_2_tx(port);
res = 0;
break;
- case TCPC_TX_HARD_RESET:
+ case TCPCI_MSG_TX_HARD_RESET:
res = send_hard_reset(port);
break;
default:
@@ -1128,7 +1128,7 @@ int tcpc_set_rx_enable(int port, int enable)
return EC_SUCCESS;
}
-int tcpc_transmit(int port, enum tcpm_sop_type type, uint16_t header,
+int tcpc_transmit(int port, enum tcpci_msg_type type, uint16_t header,
const uint32_t *data)
{
/* Store data to transmit and wake task to send it */