diff options
author | Simon Glass <sjg@chromium.org> | 2021-01-08 11:28:20 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-01-11 21:23:40 +0000 |
commit | 9f3698bc92091ca9f86b7a7779643b0e10036666 (patch) | |
tree | 7f4a4aa7f4384e2b87fbaaf539c24a6fa1c70a4c /board/volteer/usbc_config.c | |
parent | 9577f11c94055b344d2a2305f9e5ea62dd818b86 (diff) | |
download | chrome-ec-9f3698bc92091ca9f86b7a7779643b0e10036666.tar.gz |
volteer: Split out usb mux config
Move this out into the usbc_config file so that we can build for on
Zephyr.
BUG=b:175434113
BRANCH=none
TEST=make BOARD=volteer -j30
With a zephyr-chrome CL, build volteer on zephyr
Signed-off-by: Simon Glass <sjg@chromium.org>
Change-Id: I992de3acd47beb6db61e1523eedb508b5f905e22
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2617364
Reviewed-by: Keith Short <keithshort@chromium.org>
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Diffstat (limited to 'board/volteer/usbc_config.c')
-rw-r--r-- | board/volteer/usbc_config.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/board/volteer/usbc_config.c b/board/volteer/usbc_config.c index 4a6a68a83c..fa39544c49 100644 --- a/board/volteer/usbc_config.c +++ b/board/volteer/usbc_config.c @@ -12,6 +12,7 @@ #include "driver/bc12/pi3usb9201_public.h" #include "driver/ppc/sn5s330_public.h" #include "driver/ppc/syv682x_public.h" +#include "driver/retimer/bb_retimer_public.h" #include "driver/tcpm/ps8xxx_public.h" #include "driver/tcpm/rt1715_public.h" #include "driver/tcpm/tusb422_public.h" @@ -193,6 +194,43 @@ struct tcpc_config_t tcpc_config[] = { BUILD_ASSERT(ARRAY_SIZE(tcpc_config) == USBC_PORT_COUNT); BUILD_ASSERT(CONFIG_USB_PD_PORT_MAX_COUNT == USBC_PORT_COUNT); +#ifndef CONFIG_ZEPHYR /* Requires a few more CLs to build */ +/******************************************************************************/ +/* USBC mux configuration - Tiger Lake includes internal mux */ +struct usb_mux usbc1_tcss_usb_mux = { + .usb_port = USBC_PORT_C1, + .driver = &virtual_usb_mux_driver, + .hpd_update = &virtual_hpd_update, +}; + +struct usb_mux usb_muxes[] = { + [USBC_PORT_C0] = { + .usb_port = USBC_PORT_C0, + .driver = &virtual_usb_mux_driver, + .hpd_update = &virtual_hpd_update, + }, + [USBC_PORT_C1] = { + .usb_port = USBC_PORT_C1, + .driver = &bb_usb_retimer, + .next_mux = &usbc1_tcss_usb_mux, + .i2c_port = I2C_PORT_USB_1_MIX, + .i2c_addr_flags = USBC_PORT_C1_BB_RETIMER_I2C_ADDR, + }, +}; +BUILD_ASSERT(ARRAY_SIZE(usb_muxes) == USBC_PORT_COUNT); + +struct bb_usb_control bb_controls[] = { + [USBC_PORT_C0] = { + /* USB-C port 0 doesn't have a retimer */ + }, + [USBC_PORT_C1] = { + .usb_ls_en_gpio = GPIO_USB_C1_LS_EN, + .retimer_rst_gpio = GPIO_USB_C1_RT_RST_ODL, + }, +}; +BUILD_ASSERT(ARRAY_SIZE(bb_controls) == USBC_PORT_COUNT); +#endif /* CONFIG_ZEPHYR */ + /******************************************************************************/ /* BC1.2 charger detect configuration */ const struct pi3usb9201_config_t pi3usb9201_bc12_chips[] = { |