diff options
author | Denis Brockus <dbrockus@chromium.org> | 2020-02-21 14:21:05 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-02-28 22:47:11 +0000 |
commit | 9c194fd057558a1dfadee419e92aca31953a86fc (patch) | |
tree | 001ae7c162a4152312a180574ae58e19a3763eb8 /board/nami | |
parent | ab35b456ad8c52f336ea793b17155cfc796c4e44 (diff) | |
download | chrome-ec-9c194fd057558a1dfadee419e92aca31953a86fc.tar.gz |
usb_mux: retimer: mux as chained mux and retimer
This makes retimers appear as generic muxes. By allowing a
chain of muxes they can be stacked up to the new configurations
that zork requires and will continue to work as they did before
on configurations that only have a single mux.
The code used to have two different arrays, 1) muxes and 2)
retimers. On one of the zork configurations the processor
MUX stopped being the primary mux and the retimer took its
place. In a different configuration of that same platform
it left the primary and secondary alone but the mux_set
FLIP operation had to be ignored. Since the same
interfaces needed to be available for both it stopped making
sense to have two different structures and two different
methods of handling them. This consolodates the two into
one.
The platforms that do not have retimers, this change will
not make any difference. For platforms like zork, it will
remove the retimers and make them chained muxes. So
testing on trembyle makes sense to verify,
BUG=b:147593660
BRANCH=none
TEST=verify USB still works on trembyle
Change-Id: I286cf1e302f9bd3dd7e81098ec08514a2a009fe3
Signed-off-by: Denis Brockus <dbrockus@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2066794
Commit-Queue: Jett Rink <jettrink@chromium.org>
Reviewed-by: Edward Hill <ecgh@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'board/nami')
-rw-r--r-- | board/nami/board.c | 14 | ||||
-rw-r--r-- | board/nami/board.h | 1 |
2 files changed, 7 insertions, 8 deletions
diff --git a/board/nami/board.c b/board/nami/board.c index b6cbbd359d..9bbffdc755 100644 --- a/board/nami/board.c +++ b/board/nami/board.c @@ -252,19 +252,21 @@ const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_MAX_COUNT] = { }, }; -static int ps8751_tune_mux(int port) +static int ps8751_tune_mux(const struct usb_mux *me) { /* 0x98 sets lower EQ of DP port (3.6db) */ - mux_write(port, PS8XXX_REG_MUX_DP_EQ_CONFIGURATION, 0x98); + mux_write(me, PS8XXX_REG_MUX_DP_EQ_CONFIGURATION, 0x98); return EC_SUCCESS; } struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_MAX_COUNT] = { [USB_PD_PORT_PS8751] = { + .usb_port = USB_PD_PORT_PS8751, .driver = &tcpci_tcpm_usb_mux_driver, .hpd_update = &ps8xxx_tcpc_update_hpd_status, }, [USB_PD_PORT_ANX7447] = { + .usb_port = USB_PD_PORT_ANX7447, .driver = &anx7447_usb_mux_driver, .hpd_update = &anx7447_tcpc_update_hpd_status, } @@ -314,8 +316,6 @@ void board_reset_pd_mcu(void) void board_tcpc_init(void) { - int port; - /* Only reset TCPC if not sysjump */ if (!system_jumped_to_this_image()) board_reset_pd_mcu(); @@ -331,10 +331,8 @@ void board_tcpc_init(void) * Initialize HPD to low; after sysjump SOC needs to see * HPD pulse to enable video path */ - for (port = 0; port < CONFIG_USB_PD_PORT_MAX_COUNT; port++) { - const struct usb_mux *mux = &usb_muxes[port]; - mux->hpd_update(port, 0, 0); - } + for (int port = 0; port < CONFIG_USB_PD_PORT_MAX_COUNT; ++port) + usb_mux_hpd_update(port, 0, 0); } DECLARE_HOOK(HOOK_INIT, board_tcpc_init, HOOK_PRIO_INIT_I2C + 2); diff --git a/board/nami/board.h b/board/nami/board.h index e039f0dcb5..8159f13c7a 100644 --- a/board/nami/board.h +++ b/board/nami/board.h @@ -186,6 +186,7 @@ #define CONFIG_USBC_SS_MUX #define CONFIG_USBC_VCONN #define CONFIG_USBC_VCONN_SWAP +#define CONFIG_USB_MUX_RUNTIME_CONFIG /* BC 1.2 charger */ |