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>
This commit is contained in:
Jett Rink 2020-03-25 13:26:43 -06:00 committed by Commit Bot
parent 26900d2e8c
commit 471a3914c3
18 changed files with 45 additions and 45 deletions

View File

@ -193,7 +193,7 @@
#define CONFIG_USB_PID 0x5042
#define CONFIG_USB_POWER_DELIVERY
#define CONFIG_USB_PD_TCPMV2
#define CONFIG_USB_TYPEC_DRP_ACC_TRYSRC
#define CONFIG_USB_DRP_ACC_TRYSRC
/* UART COMMAND */
#define CONFIG_CMD_CHARGEN

View File

@ -152,7 +152,7 @@
#define CONFIG_USB_TYPEC_SM
#define CONFIG_USB_PRL_SM
#define CONFIG_USB_PE_SM
#define CONFIG_USB_TYPEC_DRP_ACC_TRYSRC
#define CONFIG_USB_DRP_ACC_TRYSRC
#else
/*
* PD 3.0 is always enabled by the TCPMv2 stack, so it's only explicitly

View File

@ -126,7 +126,7 @@
#define CONFIG_USB_PD_TCPMV1
#else
#define CONFIG_USB_PD_DECODE_SOP
#define CONFIG_USB_TYPEC_DRP_ACC_TRYSRC
#define CONFIG_USB_DRP_ACC_TRYSRC
/* Enable TCPMv2 Fast Role Swap */
/* Turn off until FRSwap is working */

View File

@ -65,7 +65,7 @@
#define CONFIG_USB_PD_TCPM_STUB
#define CONFIG_USB_POWER_DELIVERY
#define CONFIG_USB_PD_TCPMV2
#define CONFIG_USB_TYPEC_CTVPD
#define CONFIG_USB_CTVPD
#define CONFIG_USB_PD_DECODE_SOP
#define CONFIG_USB_PD_DUAL_ROLE
#define CONFIG_USB_PD_INTERNAL_COMP

View File

@ -184,7 +184,7 @@
#define CONFIG_USB_PD_TCPM_TCPCI
#define CONFIG_USB_PD_TCPM_ANX7447
#define CONFIG_USB_PD_TRY_SRC
#define CONFIG_USB_TYPEC_DRP_ACC_TRYSRC
#define CONFIG_USB_DRP_ACC_TRYSRC
#define CONFIG_USBC_SS_MUX
#define CONFIG_USBC_SS_MUX_DFP_ONLY
#define CONFIG_USBC_VCONN

View File

@ -111,7 +111,7 @@
/* USB */
#define CONFIG_USB_POWER_DELIVERY
#define CONFIG_USB_PD_TCPMV2
#define CONFIG_USB_TYPEC_DRP_ACC_TRYSRC
#define CONFIG_USB_DRP_ACC_TRYSRC
#define CONFIG_USB_PD_DECODE_SOP
#define CONFIG_CMD_PD_CONTROL
#define CONFIG_USB_PD_ALT_MODE

View File

@ -453,7 +453,7 @@ void pd_rx_handler(void)
int next_idx;
pending = STM32_EXTI_PR;
#ifdef CONFIG_USB_TYPEC_CTVPD
#ifdef CONFIG_USB_CTVPD
/* Charge-Through Side detach event */
if (pending & EXTI_COMP2_MASK) {
task_set_event(PD_PORT_TO_TASK_ID(0), PD_EVENT_SM, 0);

View File

@ -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;

View File

@ -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:

View File

@ -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

View File

@ -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

View File

@ -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;

View File

@ -50,7 +50,7 @@
#define CONFIG_USB_POWER_DELIVERY
#define CONFIG_USB_PRL_SM
#define CONFIG_USB_PD_TCPMV2
#define CONFIG_USB_TYPEC_DRP_ACC_TRYSRC
#define CONFIG_USB_DRP_ACC_TRYSRC
#define CONFIG_USBC_VCONN
#define CONFIG_USBC_VCONN_SWAP
#define PD_VCONN_SWAP_DELAY 5000

View File

@ -4003,13 +4003,13 @@
#undef CONFIG_USB_PD_PREFER_MV
/* Type-C VCONN Powered Device */
#undef CONFIG_USB_TYPEC_VPD
#undef CONFIG_USB_VPD
/* Type-C Charge Through VCONN Powered Device */
#undef CONFIG_USB_TYPEC_CTVPD
#undef CONFIG_USB_CTVPD
/* Type-C DRP with Accessory and Try.SRC */
#undef CONFIG_USB_TYPEC_DRP_ACC_TRYSRC
#undef CONFIG_USB_DRP_ACC_TRYSRC
/* Type-C Fast Role Swap */
#undef CONFIG_USB_TYPEC_PD_FAST_ROLE_SWAP

View File

@ -374,7 +374,7 @@ uint32_t tc_get_flags(int port);
*/
void tc_print_dev_info(int port);
#ifdef CONFIG_USB_TYPEC_CTVPD
#ifdef CONFIG_USB_CTVPD
/**
* Resets the charge-through support timer. This can be
@ -391,6 +391,6 @@ void tc_reset_support_timer(int port);
*
*/
void tc_ctvpd_detected(int port);
#endif /* CONFIG_USB_TYPEC_CTVPD */
#endif /* CONFIG_USB_CTVPD */
#endif /* __CROS_EC_USB_TC_H */

View File

@ -178,8 +178,8 @@ uint8_t pd_get_src_cap_cnt(int port)
}
#endif
#if !defined(CONFIG_USB_TYPEC_DRP_ACC_TRYSRC) && \
!defined(CONFIG_USB_TYPEC_CTVPD)
#if !defined(CONFIG_USB_DRP_ACC_TRYSRC) && \
!defined(CONFIG_USB_CTVPD)
int pd_is_connected(int port)
{
return true;
@ -189,9 +189,9 @@ bool pd_is_disconnected(int port)
{
return false;
}
#endif /* !CONFIG_USB_TYPEC_DRP_ACC_TRYSRC && !CONFIG_USB_TYPEC_CTVPD */
#endif /* !CONFIG_USB_DRP_ACC_TRYSRC && !CONFIG_USB_CTVPD */
#ifndef CONFIG_USB_TYPEC_DRP_ACC_TRYSRC
#ifndef CONFIG_USB_DRP_ACC_TRYSRC
void pd_set_dual_role(int port, enum pd_dual_role_states state)
{
}
@ -230,4 +230,4 @@ const char *pd_get_task_state_name(int port)
{
return NULL;
}
#endif /* CONFIG_USB_TYPEC_DRP_ACC_TRYSRC */
#endif /* CONFIG_USB_DRP_ACC_TRYSRC */

View File

@ -389,15 +389,15 @@ int ncp15wb_calculate_temp(uint16_t adc);
#endif /* Common TypeC test defines */
#ifdef TEST_USB_TYPEC_VPD
#define CONFIG_USB_TYPEC_VPD
#define CONFIG_USB_VPD
#endif
#ifdef TEST_USB_TYPEC_CTVPD
#define CONFIG_USB_TYPEC_CTVPD
#define CONFIG_USB_CTVPD
#endif
#ifdef TEST_USB_TYPEC_DRP_ACC_TRYSRC
#define CONFIG_USB_TYPEC_DRP_ACC_TRYSRC
#define CONFIG_USB_DRP_ACC_TRYSRC
#define CONFIG_USB_PD_DUAL_ROLE
#define CONFIG_USB_PD_TRY_SRC
#define CONFIG_USB_TYPEC_SM

View File

@ -558,7 +558,7 @@ static int test_vpd_host_src_detection_message_reception(void)
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