summaryrefslogtreecommitdiff
path: root/common/usbc/usb_pd_host.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/usbc/usb_pd_host.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/usbc/usb_pd_host.c')
-rw-r--r--common/usbc/usb_pd_host.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/common/usbc/usb_pd_host.c b/common/usbc/usb_pd_host.c
index e4d044097b..514ef82036 100644
--- a/common/usbc/usb_pd_host.c
+++ b/common/usbc/usb_pd_host.c
@@ -24,7 +24,7 @@ static enum ec_status hc_typec_discovery(struct host_cmd_handler_args *args)
const struct ec_params_typec_discovery *p = args->params;
struct ec_response_typec_discovery *r = args->response;
const struct pd_discovery *disc;
- enum tcpm_sop_type type;
+ enum tcpci_msg_type type;
/* Confirm the number of HC VDOs matches our stored VDOs */
BUILD_ASSERT(sizeof(r->discovery_vdo) == sizeof(union disc_ident_ack));
@@ -36,7 +36,7 @@ static enum ec_status hc_typec_discovery(struct host_cmd_handler_args *args)
return EC_RES_INVALID_PARAM;
type = p->partner_type == TYPEC_PARTNER_SOP ?
- TCPC_TX_SOP : TCPC_TX_SOP_PRIME;
+ TCPCI_MSG_SOP : TCPCI_MSG_SOP_PRIME;
/*
* Clear out access mask so we can track if tasks have touched data
@@ -156,10 +156,12 @@ static enum ec_status hc_typec_status(struct host_cmd_handler_args *args)
r->events = pd_get_events(p->port);
r->sop_revision = r->sop_connected ?
- PD_STATUS_REV_SET_MAJOR(pd_get_rev(p->port, TCPC_TX_SOP)) : 0;
- r->sop_prime_revision = pd_get_identity_discovery(p->port,
- TCPC_TX_SOP_PRIME) == PD_DISC_COMPLETE ?
- PD_STATUS_REV_SET_MAJOR(pd_get_rev(p->port, TCPC_TX_SOP_PRIME))
+ PD_STATUS_REV_SET_MAJOR(pd_get_rev(p->port, TCPCI_MSG_SOP)) : 0;
+ r->sop_prime_revision =
+ pd_get_identity_discovery(p->port, TCPCI_MSG_SOP_PRIME) ==
+ PD_DISC_COMPLETE ?
+ PD_STATUS_REV_SET_MAJOR(pd_get_rev(p->port,
+ TCPCI_MSG_SOP_PRIME))
: 0;
r->source_cap_count = pd_get_src_cap_cnt(p->port);