From 90c512e25b5ffc8b3c04eb52d3242b29ea13f86c Mon Sep 17 00:00:00 2001 From: Tomasz Michalec Date: Wed, 20 Jul 2022 13:36:26 +0200 Subject: goroh: usb_mux: Split struct usb_mux in goroh board Update goroh board to use new struct usb_mux_chain. BUG=b:236274003 TEST=make buildall BRANCH=None Cq-Depend: chromium:3748785 Signed-off-by: Tomasz Michalec Change-Id: I978b1174f8ab2f3274c242c460243c5d97067496 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3780408 Tested-by: Tomasz Michalec Commit-Queue: Tomasz Michalec Reviewed-by: Keith Short --- baseboard/goroh/usbc_config.c | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/baseboard/goroh/usbc_config.c b/baseboard/goroh/usbc_config.c index f417190f28..d33b0ac836 100644 --- a/baseboard/goroh/usbc_config.c +++ b/baseboard/goroh/usbc_config.c @@ -76,25 +76,32 @@ static struct usb_mux_driver goroh_usb_c0_mux_driver = { .get = goroh_usb_c0_get_mux, }; -static const struct usb_mux goroh_usb_c1_ps8818_retimer = { - .usb_port = USBC_PORT_C1, - .i2c_port = I2C_PORT_USB_C1, - .i2c_addr_flags = PS8818_I2C_ADDR_FLAGS, - .driver = &ps8818_usb_retimer_driver, - .next_mux = NULL, +static const struct usb_mux_chain goroh_usb_c1_ps8818_retimer = { + .mux = + &(const struct usb_mux){ + .usb_port = USBC_PORT_C1, + .i2c_port = I2C_PORT_USB_C1, + .i2c_addr_flags = PS8818_I2C_ADDR_FLAGS, + .driver = &ps8818_usb_retimer_driver, + }, + .next = NULL, }; -const struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_MAX_COUNT] = { +const struct usb_mux_chain usb_muxes[CONFIG_USB_PD_PORT_MAX_COUNT] = { [USBC_PORT_C0] = { - .usb_port = USBC_PORT_C0, - .driver = &goroh_usb_c0_mux_driver, - .hpd_update = &virtual_hpd_update, + .mux = &(const struct usb_mux) { + .usb_port = USBC_PORT_C0, + .driver = &goroh_usb_c0_mux_driver, + .hpd_update = &virtual_hpd_update, + }, }, [USBC_PORT_C1] = { - .usb_port = USBC_PORT_C1, - .driver = &virtual_usb_mux_driver, - .hpd_update = &virtual_hpd_update, - .next_mux = &goroh_usb_c1_ps8818_retimer, + .mux = &(const struct usb_mux) { + .usb_port = USBC_PORT_C1, + .driver = &virtual_usb_mux_driver, + .hpd_update = &virtual_hpd_update, + }, + .next = &goroh_usb_c1_ps8818_retimer, }, }; BUILD_ASSERT(ARRAY_SIZE(usb_muxes) == USBC_PORT_COUNT); -- cgit v1.2.1