diff options
author | Denis Brockus <dbrockus@chromium.org> | 2019-11-12 07:56:53 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-11-13 18:31:01 +0000 |
commit | dc850cb6b6feef79d783f28d5f45d3a25b4022d0 (patch) | |
tree | 7012f167e6a1fa8a4f87fc1897ca5ede9b3ae396 | |
parent | 3c315108e549bd6285d2729372151cda913c7b53 (diff) | |
download | chrome-ec-dc850cb6b6feef79d783f28d5f45d3a25b4022d0.tar.gz |
retimer: usbc retimer name cleanup
Need to cleanup naming around USBC Retimers for adding
PI2DPX1207 code
BUG=none
BRANCH=none
TEST=make buildall -j
Change-Id: I7e18e0abbe5bfd89bf0e20fa7b5174669689778f
Signed-off-by: Denis Brockus <dbrockus@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1911296
Reviewed-by: Edward Hill <ecgh@chromium.org>
-rw-r--r-- | baseboard/intelrvp/build.mk | 2 | ||||
-rw-r--r-- | baseboard/intelrvp/retimer.c | 4 | ||||
-rw-r--r-- | board/tglrvpu_ite/board.h | 2 | ||||
-rw-r--r-- | common/usb_pd_protocol.c | 2 | ||||
-rw-r--r-- | driver/build.mk | 2 | ||||
-rw-r--r-- | driver/retimer/bb_retimer.h | 2 | ||||
-rw-r--r-- | driver/usb_mux/virtual.c | 16 | ||||
-rw-r--r-- | include/config.h | 27 | ||||
-rw-r--r-- | include/usb_pd.h | 2 |
9 files changed, 35 insertions, 24 deletions
diff --git a/baseboard/intelrvp/build.mk b/baseboard/intelrvp/build.mk index bfbd86abce..8b22ee835c 100644 --- a/baseboard/intelrvp/build.mk +++ b/baseboard/intelrvp/build.mk @@ -22,7 +22,7 @@ baseboard-$(CONFIG_BC12_DETECT_MAX14637)+=bc12.o baseboard-$(CONFIG_USB_MUX_VIRTUAL)+=usb_mux.o #USB Retimer specific files -baseboard-$(CONFIG_USB_PD_RETIMER_INTEL_BB)+=retimer.o +baseboard-$(CONFIG_USBC_RETIMER_INTEL_BB)+=retimer.o #VBUS detection specific files baseboard-$(CONFIG_USB_PD_VBUS_DETECT_GPIO)+=vbus.o diff --git a/baseboard/intelrvp/retimer.c b/baseboard/intelrvp/retimer.c index 4ab6785d6f..33ada53254 100644 --- a/baseboard/intelrvp/retimer.c +++ b/baseboard/intelrvp/retimer.c @@ -10,7 +10,7 @@ #include "common.h" /* USB Retimers configuration */ -#ifdef CONFIG_USB_PD_RETIMER_INTEL_BB +#ifdef CONFIG_USBC_RETIMER_INTEL_BB struct bb_retimer bb_retimers[CONFIG_USB_PD_PORT_MAX_COUNT] = { [TYPE_C_PORT_0] = { .i2c_port = I2C_PORT0_BB_RETIMER, @@ -32,4 +32,4 @@ struct bb_retimer bb_retimers[CONFIG_USB_PD_PORT_MAX_COUNT] = { #endif /* HAS_TASK_PD_C1 */ }; BUILD_ASSERT(ARRAY_SIZE(bb_retimers) == CONFIG_USB_PD_PORT_MAX_COUNT); -#endif /* CONFIG_USB_PD_RETIMER_INTEL_BB */ +#endif /* CONFIG_USBC_RETIMER_INTEL_BB */ diff --git a/board/tglrvpu_ite/board.h b/board/tglrvpu_ite/board.h index a28f8513a1..408c8a078d 100644 --- a/board/tglrvpu_ite/board.h +++ b/board/tglrvpu_ite/board.h @@ -56,7 +56,7 @@ /* Config BB retimer */ -#define CONFIG_USB_PD_RETIMER_INTEL_BB +#define CONFIG_USBC_RETIMER_INTEL_BB /* Thermal configs */ diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c index 99ef76d62e..28fe9aa4cd 100644 --- a/common/usb_pd_protocol.c +++ b/common/usb_pd_protocol.c @@ -393,7 +393,7 @@ int pd_is_vbus_present(int port) #endif } -#ifdef CONFIG_USB_PD_RETIMER +#ifdef CONFIG_USBC_VIRTUAL_MUX_RETIMER /** * This function checks the current CC status of the port partner * and returns true if the attached partner is UFP. diff --git a/driver/build.mk b/driver/build.mk index 4a22432ded..edd97a09a9 100644 --- a/driver/build.mk +++ b/driver/build.mk @@ -138,7 +138,7 @@ driver-$(CONFIG_USB_PD_TCPM_TUSB422)+=tcpm/tusb422.o driver-$(CONFIG_USB_PD_TCPM_NCT38XX)+=tcpm/nct38xx.o # Type-C Retimer drivers -driver-$(CONFIG_USB_PD_RETIMER_INTEL_BB)+=retimer/bb_retimer.o +driver-$(CONFIG_USBC_RETIMER_INTEL_BB)+=retimer/bb_retimer.o # USB mux high-level driver driver-$(CONFIG_USBC_SS_MUX)+=usb_mux/usb_mux.o diff --git a/driver/retimer/bb_retimer.h b/driver/retimer/bb_retimer.h index faecfef4ba..7134517325 100644 --- a/driver/retimer/bb_retimer.h +++ b/driver/retimer/bb_retimer.h @@ -49,7 +49,7 @@ struct bb_retimer { /* * USB Retimers in system, ordered by PD port #, defined at board-level - * CONFIG_USB_PD_RETIMER_INTEL_BB need to be defind at board-level. + * CONFIG_USBC_RETIMER_INTEL_BB need to be defind at board-level. */ extern struct bb_retimer bb_retimers[]; diff --git a/driver/usb_mux/virtual.c b/driver/usb_mux/virtual.c index 70a51953ad..7dc0d9087b 100644 --- a/driver/usb_mux/virtual.c +++ b/driver/usb_mux/virtual.c @@ -28,21 +28,19 @@ static inline void virtual_mux_update_state(int port, mux_state_t mux_state) { if (virtual_mux_state[port] != mux_state) { virtual_mux_state[port] = mux_state; -#ifdef CONFIG_USB_PD_RETIMER - if (retimer_set_state(port, mux_state)) + if (IS_ENABLED(CONFIG_USBC_VIRTUAL_MUX_RETIMER) && + retimer_set_state(port, mux_state)) return; -#endif host_set_single_event(EC_HOST_EVENT_USB_MUX); } } static int virtual_init(int port) { -#ifdef CONFIG_USB_PD_RETIMER - return retimer_init(port); -#else - return EC_SUCCESS; -#endif + if (IS_ENABLED(CONFIG_USBC_VIRTUAL_MUX_RETIMER)) + return retimer_init(port); + else + return EC_SUCCESS; } /* @@ -86,7 +84,7 @@ const struct usb_mux_driver virtual_usb_mux_driver = { .init = virtual_init, .set = virtual_set_mux, .get = virtual_get_mux, -#ifdef CONFIG_USB_PD_RETIMER +#ifdef CONFIG_USBC_VIRTUAL_MUX_RETIMER .enter_low_power_mode = retimer_low_power_mode, #endif }; diff --git a/include/config.h b/include/config.h index c51fd4d4d1..60f8768c12 100644 --- a/include/config.h +++ b/include/config.h @@ -3794,14 +3794,23 @@ #undef CONFIG_USB_PD_TCPM_TUSB422 /* - * Type-C multi-protocol retimer is present. + * Type-C retimer mux configuration tends to be set on a specific + * driver's need basis. After including the board/baseboard.h files + * the drivers will be checked and if one of these are needed it will + * automatically be included. This does not stop a board/basebord.h + * configration from defining these as well. */ -#undef CONFIG_USB_PD_RETIMER + +/* Type-C retimer used with virtual mux */ +#undef CONFIG_USBC_VIRTUAL_MUX_RETIMER + +/* Type-C retimer used with real mux */ +#undef CONFIG_USBC_MUX_RETIMER /* - * Type-C multi-protocol retimer to be used in on-board applications. + * Type-C retimer drivers to be used in on-board applications. */ -#undef CONFIG_USB_PD_RETIMER_INTEL_BB +#undef CONFIG_USBC_RETIMER_INTEL_BB /* * Adds an EC console command to erase the ANX7447 OCM flash. @@ -4680,9 +4689,13 @@ #endif /*****************************************************************************/ -/* Define derived config options for Retimer chips */ -#ifdef CONFIG_USB_PD_RETIMER_INTEL_BB -#define CONFIG_USB_PD_RETIMER +/* + * Define derived config options for Retimer chips. There are + * for convenience. Any retimer driver that also needs USBC MUX Retimers + * will not have to include it in their own board/baseboard.h file. + */ +#ifdef CONFIG_USBC_RETIMER_INTEL_BB +#define CONFIG_USBC_VIRTUAL_MUX_RETIMER #endif /*****************************************************************************/ diff --git a/include/usb_pd.h b/include/usb_pd.h index 05e6fe0f02..a73bb382af 100644 --- a/include/usb_pd.h +++ b/include/usb_pd.h @@ -2278,7 +2278,7 @@ static inline uint8_t board_get_usb_pd_port_count(void) #endif /* CONFIG_USB_POWER_DELIVERY */ #endif /* CONFIG_USB_PD_PORT_MAX_COUNT */ -#ifdef CONFIG_USB_PD_RETIMER +#ifdef CONFIG_USBC_VIRTUAL_MUX_RETIMER /** * Return true if specified PD port partner is UFP. * |