From e52cd41d9a438445896467ebeb01509a6367a969 Mon Sep 17 00:00:00 2001 From: Tomasz Michalec Date: Wed, 20 Jul 2022 12:36:07 +0200 Subject: reef: usb_mux: Split struct usb_mux in reef boards Update reef boards 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: Ie43ed5adf490a05230815284c94c971c77fc7af0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3780405 Reviewed-by: Keith Short Tested-by: Tomasz Michalec Commit-Queue: Tomasz Michalec --- board/reef/board.c | 20 ++++++++++++-------- board/reef_it8320/board.c | 28 +++++++++++++++++----------- board/reef_mchp/board.c | 20 ++++++++++++-------- 3 files changed, 41 insertions(+), 27 deletions(-) diff --git a/board/reef/board.c b/board/reef/board.c index 6cc4a864cd..5e608ee4ee 100644 --- a/board/reef/board.c +++ b/board/reef/board.c @@ -296,17 +296,21 @@ static int ps8751_tune_mux(const struct usb_mux *me) return EC_SUCCESS; } -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] = { [USB_PD_PORT_ANX74XX] = { - .usb_port = USB_PD_PORT_ANX74XX, - .driver = &anx74xx_tcpm_usb_mux_driver, - .hpd_update = &anx74xx_tcpc_update_hpd_status, + .mux = &(const struct usb_mux) { + .usb_port = USB_PD_PORT_ANX74XX, + .driver = &anx74xx_tcpm_usb_mux_driver, + .hpd_update = &anx74xx_tcpc_update_hpd_status, + }, }, [USB_PD_PORT_PS8751] = { - .usb_port = USB_PD_PORT_PS8751, - .driver = &tcpci_tcpm_usb_mux_driver, - .hpd_update = &ps8xxx_tcpc_update_hpd_status, - .board_init = &ps8751_tune_mux, + .mux = &(const struct usb_mux) { + .usb_port = USB_PD_PORT_PS8751, + .driver = &tcpci_tcpm_usb_mux_driver, + .hpd_update = &ps8xxx_tcpc_update_hpd_status, + .board_init = &ps8751_tune_mux, + }, } }; diff --git a/board/reef_it8320/board.c b/board/reef_it8320/board.c index 65b5949d13..b00e451842 100644 --- a/board/reef_it8320/board.c +++ b/board/reef_it8320/board.c @@ -133,20 +133,26 @@ static void it83xx_tcpc_update_hpd_status(const struct usb_mux *me, } } -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] = { { - .usb_port = 0, - .i2c_port = I2C_PORT_USB_MUX, - .i2c_addr_flags = PI3USB3X532_I2C_ADDR0, - .driver = &pi3usb3x532_usb_mux_driver, - .hpd_update = &it83xx_tcpc_update_hpd_status, + .mux = + &(const struct usb_mux){ + .usb_port = 0, + .i2c_port = I2C_PORT_USB_MUX, + .i2c_addr_flags = PI3USB3X532_I2C_ADDR0, + .driver = &pi3usb3x532_usb_mux_driver, + .hpd_update = &it83xx_tcpc_update_hpd_status, + }, }, { - .usb_port = 1, - .i2c_port = I2C_PORT_USB_MUX, - .i2c_addr_flags = 0x10, - .driver = &ps8740_usb_mux_driver, - .hpd_update = &it83xx_tcpc_update_hpd_status, + .mux = + &(const struct usb_mux){ + .usb_port = 1, + .i2c_port = I2C_PORT_USB_MUX, + .i2c_addr_flags = 0x10, + .driver = &ps8740_usb_mux_driver, + .hpd_update = &it83xx_tcpc_update_hpd_status, + }, }, }; diff --git a/board/reef_mchp/board.c b/board/reef_mchp/board.c index dfaf0d2564..39196cb308 100644 --- a/board/reef_mchp/board.c +++ b/board/reef_mchp/board.c @@ -399,17 +399,21 @@ static int ps8751_tune_mux(const struct usb_mux *me) * tcpc_config array. The tcpc_config array contains the actual EC I2C * port, device address, and a function pointer into the driver code. */ -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] = { [USB_PD_PORT_ANX74XX] = { - .usb_port = USB_PD_PORT_ANX74XX, - .driver = &anx74xx_tcpm_usb_mux_driver, - .hpd_update = &anx74xx_tcpc_update_hpd_status, + .mux = &(const struct usb_mux) { + .usb_port = USB_PD_PORT_ANX74XX, + .driver = &anx74xx_tcpm_usb_mux_driver, + .hpd_update = &anx74xx_tcpc_update_hpd_status, + }, }, [USB_PD_PORT_PS8751] = { - .usb_port = USB_PD_PORT_PS8751, - .driver = &tcpci_tcpm_usb_mux_driver, - .hpd_update = &ps8xxx_tcpc_update_hpd_status, - .board_init = &ps8751_tune_mux, + .mux = &(const struct usb_mux) { + .usb_port = USB_PD_PORT_PS8751, + .driver = &tcpci_tcpm_usb_mux_driver, + .hpd_update = &ps8xxx_tcpc_update_hpd_status, + .board_init = &ps8751_tune_mux, + }, } }; -- cgit v1.2.1