diff options
author | Jett Rink <jettrink@chromium.org> | 2020-03-25 13:26:43 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-03-26 00:41:25 +0000 |
commit | 471a3914c32d856610b237bdb9e12ad8790a5ae3 (patch) | |
tree | 89b0bd83e3931634d7b89447227a951ad0311f62 /common | |
parent | 26900d2e8c76f9b04d560def5aa459fd42742341 (diff) | |
download | chrome-ec-471a3914c32d856610b237bdb9e12ad8790a5ae3.tar.gz |
cleanup: drop the _TYPEC part of USB device config
The three USB device configurations describe more than just the Type-C
layer, so remove the _TYPEC part within the define. This is also in
preparation to change how the usbc build.mk includes files.
This was performed with the following commands:
$ git grep --name-only CONFIG_USB_TYPEC_DRP_ACC_TRYSRC | xargs perl -i
-ple 's/CONFIG_USB_TYPEC_DRP_ACC_TRYSRC/CONFIG_USB_DRP_ACC_TRYSRC/g'
$ git grep --name-only CONFIG_USB_TYPEC_CTVPD | xargs perl -i -ple
's/CONFIG_USB_TYPEC_CTVPD/CONFIG_USB_CTVPD/g'
$ git grep --name-only CONFIG_USB_TYPEC_VPD | xargs perl -i -ple
's/CONFIG_USB_TYPEC_VPD/CONFIG_USB_VPD/g'
BRANCH=none
BUG=none
TEST=builds
Signed-off-by: Jett Rink <jettrink@chromium.org>
Change-Id: I4deab784b7c3479cffd3dee7fb3ea3c8a9d6081c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2121193
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Commit-Queue: Denis Brockus <dbrockus@chromium.org>
Diffstat (limited to 'common')
-rw-r--r-- | common/usb_pd_host_cmd.c | 4 | ||||
-rw-r--r-- | common/usb_pd_tcpc.c | 10 | ||||
-rw-r--r-- | common/usbc/build.mk | 12 | ||||
-rw-r--r-- | common/usbc/usb_pe_ctvpd_sm.c | 4 | ||||
-rw-r--r-- | common/usbc/usb_prl_sm.c | 16 |
5 files changed, 23 insertions, 23 deletions
diff --git a/common/usb_pd_host_cmd.c b/common/usb_pd_host_cmd.c index 1de3944502..d7106c4625 100644 --- a/common/usb_pd_host_cmd.c +++ b/common/usb_pd_host_cmd.c @@ -405,8 +405,8 @@ static enum ec_status hc_get_pd_port_caps(struct host_cmd_handler_args *args) else r->pd_try_power_role_cap = EC_PD_TRY_POWER_ROLE_NONE; - if (IS_ENABLED(CONFIG_USB_TYPEC_VPD) || - IS_ENABLED(CONFIG_USB_TYPEC_CTVPD)) + if (IS_ENABLED(CONFIG_USB_VPD) || + IS_ENABLED(CONFIG_USB_CTVPD)) r->pd_data_role_cap = EC_PD_DATA_ROLE_UFP; else r->pd_data_role_cap = EC_PD_DATA_ROLE_DUAL; diff --git a/common/usb_pd_tcpc.c b/common/usb_pd_tcpc.c index 2fabd8454c..d8290c49bb 100644 --- a/common/usb_pd_tcpc.c +++ b/common/usb_pd_tcpc.c @@ -314,7 +314,7 @@ int prepare_message(int port, uint16_t header, uint8_t cnt, int off, i; /* 64-bit preamble */ off = pd_write_preamble(port); -#if defined(CONFIG_USB_TYPEC_VPD) || defined(CONFIG_USB_TYPEC_CTVPD) +#if defined(CONFIG_USB_VPD) || defined(CONFIG_USB_CTVPD) /* Start Of Packet Prime: 2x Sync-1 + 2x Sync-3 */ off = pd_write_sym(port, off, BMC(PD_SYNC1)); off = pd_write_sym(port, off, BMC(PD_SYNC1)); @@ -660,7 +660,7 @@ int pd_analyze_rx(int port, uint32_t *payload) /* Find the Start Of Packet sequence */ while (bit > 0) { bit = pd_dequeue_bits(port, bit, 20, &val); -#if defined(CONFIG_USB_TYPEC_VPD) || defined(CONFIG_USB_TYPEC_CTVPD) +#if defined(CONFIG_USB_VPD) || defined(CONFIG_USB_CTVPD) if (val == PD_SOP_PRIME) { break; } else if (val == PD_SOP) { @@ -670,7 +670,7 @@ int pd_analyze_rx(int port, uint32_t *payload) CPRINTF("SOP''\n"); return PD_RX_ERR_UNSUPPORTED_SOP; } -#else /* CONFIG_USB_TYPEC_VPD || CONFIG_USB_TYPEC_CTVPD */ +#else /* CONFIG_USB_VPD || CONFIG_USB_CTVPD */ #ifdef CONFIG_USB_PD_DECODE_SOP if (val == PD_SOP || val == PD_SOP_PRIME || val == PD_SOP_PRIME_PRIME) @@ -686,7 +686,7 @@ int pd_analyze_rx(int port, uint32_t *payload) return PD_RX_ERR_UNSUPPORTED_SOP; } #endif /* CONFIG_USB_PD_DECODE_SOP */ -#endif /* CONFIG_USB_TYPEC_VPD || CONFIG_USB_TYPEC_CTVPD */ +#endif /* CONFIG_USB_VPD || CONFIG_USB_CTVPD */ } if (bit < 0) { #ifdef CONFIG_USB_PD_DECODE_SOP @@ -862,7 +862,7 @@ int tcpc_run(int port, int evt) /* outgoing packet ? */ if ((evt & PD_EVENT_TX) && pd[port].rx_enabled) { switch (pd[port].tx_type) { -#if defined(CONFIG_USB_TYPEC_VPD) || defined(CONFIG_USB_TYPEC_CTVPD) +#if defined(CONFIG_USB_VPD) || defined(CONFIG_USB_CTVPD) case TCPC_TX_SOP_PRIME: #else case TCPC_TX_SOP: diff --git a/common/usbc/build.mk b/common/usbc/build.mk index 781c6a9d10..df86de996f 100644 --- a/common/usbc/build.mk +++ b/common/usbc/build.mk @@ -12,13 +12,13 @@ all-obj-$(CONFIG_USB_PD_TCPMV2)+=$(_usbc_dir)usb_sm.o all-obj-$(CONFIG_USB_TYPEC_SM)+=$(_usbc_dir)usbc_task.o all-obj-$(CONFIG_USB_PRL_SM)+=$(_usbc_dir)usb_prl_sm.o ifneq ($(CONFIG_USB_PE_SM),) -all-obj-$(CONFIG_USB_TYPEC_VPD)+=$(_usbc_dir)usb_pe_ctvpd_sm.o -all-obj-$(CONFIG_USB_TYPEC_CTVPD)+=$(_usbc_dir)usb_pe_ctvpd_sm.o -all-obj-$(CONFIG_USB_TYPEC_DRP_ACC_TRYSRC)+=$(_usbc_dir)usb_pe_drp_sm.o +all-obj-$(CONFIG_USB_VPD)+=$(_usbc_dir)usb_pe_ctvpd_sm.o +all-obj-$(CONFIG_USB_CTVPD)+=$(_usbc_dir)usb_pe_ctvpd_sm.o +all-obj-$(CONFIG_USB_DRP_ACC_TRYSRC)+=$(_usbc_dir)usb_pe_drp_sm.o all-obj-$(CONFIG_TEST_USB_PE_SM)+=$(_usbc_dir)usb_pe_drp_sm.o endif -all-obj-$(CONFIG_USB_TYPEC_VPD)+=$(_usbc_dir)usb_tc_vpd_sm.o -all-obj-$(CONFIG_USB_TYPEC_CTVPD)+=$(_usbc_dir)usb_tc_ctvpd_sm.o -all-obj-$(CONFIG_USB_TYPEC_DRP_ACC_TRYSRC)+=\ +all-obj-$(CONFIG_USB_VPD)+=$(_usbc_dir)usb_tc_vpd_sm.o +all-obj-$(CONFIG_USB_CTVPD)+=$(_usbc_dir)usb_tc_ctvpd_sm.o +all-obj-$(CONFIG_USB_DRP_ACC_TRYSRC)+=\ $(_usbc_dir)usb_tc_drp_acc_trysrc_sm.o endif diff --git a/common/usbc/usb_pe_ctvpd_sm.c b/common/usbc/usb_pe_ctvpd_sm.c index 8f3233e0d7..96afc42f49 100644 --- a/common/usbc/usb_pe_ctvpd_sm.c +++ b/common/usbc/usb_pe_ctvpd_sm.c @@ -139,7 +139,7 @@ static void pe_request_run(const int port) if (PD_VDO_CMD(vdo) != CMD_DISCOVER_IDENT) return; -#ifdef CONFIG_USB_TYPEC_CTVPD +#ifdef CONFIG_USB_CTVPD /* * We have a valid DISCOVER IDENTITY message. * Attempt to reset support timer @@ -179,7 +179,7 @@ static void pe_request_run(const int port) VPD_MAX_VBUS_20V, VPD_VBUS_IMP(VPD_VBUS_IMPEDANCE), VPD_GND_IMP(VPD_GND_IMPEDANCE), -#ifdef CONFIG_USB_TYPEC_CTVPD +#ifdef CONFIG_USB_CTVPD VPD_CTS_SUPPORTED #else VPD_CTS_NOT_SUPPORTED diff --git a/common/usbc/usb_prl_sm.c b/common/usbc/usb_prl_sm.c index 769a103fe5..b946195d05 100644 --- a/common/usbc/usb_prl_sm.c +++ b/common/usbc/usb_prl_sm.c @@ -424,8 +424,8 @@ void prl_run(int port, int evt, int en) case SM_RUN: if (!en) { /* Disable RX */ - if (IS_ENABLED(CONFIG_USB_TYPEC_CTVPD) || - IS_ENABLED(CONFIG_USB_TYPEC_VPD)) + if (IS_ENABLED(CONFIG_USB_CTVPD) || + IS_ENABLED(CONFIG_USB_VPD)) vpd_rx_enable(0); else tcpm_set_rx_enable(port, 0); @@ -465,8 +465,8 @@ enum pd_rev_type prl_get_rev(int port, enum tcpm_transmit_type type) /* Common Protocol Layer Message Transmission */ static void prl_tx_phy_layer_reset_entry(const int port) { - if (IS_ENABLED(CONFIG_USB_TYPEC_CTVPD) - || IS_ENABLED(CONFIG_USB_TYPEC_VPD)) { + if (IS_ENABLED(CONFIG_USB_CTVPD) + || IS_ENABLED(CONFIG_USB_VPD)) { vpd_rx_enable(pd_is_connected(port)); } else { tcpm_clear_pending_messages(port); @@ -852,8 +852,8 @@ static void prl_hr_reset_layer_entry(const int port) } /* Disable RX */ - if (IS_ENABLED(CONFIG_USB_TYPEC_CTVPD) || - IS_ENABLED(CONFIG_USB_TYPEC_VPD)) + if (IS_ENABLED(CONFIG_USB_CTVPD) || + IS_ENABLED(CONFIG_USB_VPD)) vpd_rx_enable(0); else tcpm_set_rx_enable(port, 0); @@ -1552,8 +1552,8 @@ static void prl_rx_wait_for_phy_message(const int port, int evt) * Ignore messages sent to the cable from our * port partner if we aren't Vconn powered device. */ - if (!IS_ENABLED(CONFIG_USB_TYPEC_CTVPD) && - !IS_ENABLED(CONFIG_USB_TYPEC_VPD) && + if (!IS_ENABLED(CONFIG_USB_CTVPD) && + !IS_ENABLED(CONFIG_USB_VPD) && PD_HEADER_GET_SOP(header) != PD_MSG_SOP && PD_HEADER_PROLE(header) == PD_PLUG_FROM_DFP_UFP) return; |