summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomasz Michalec <tm@semihalf.com>2022-07-20 12:36:07 +0200
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-09-13 11:15:50 +0000
commite52cd41d9a438445896467ebeb01509a6367a969 (patch)
treeb3db041eebbaee76936714ea822f90b7d5845714
parent648a7671fdf43a106ed3bfc2963830a2aa698e2d (diff)
downloadchrome-ec-e52cd41d9a438445896467ebeb01509a6367a969.tar.gz
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 <tm@semihalf.com> Change-Id: Ie43ed5adf490a05230815284c94c971c77fc7af0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3780405 Reviewed-by: Keith Short <keithshort@chromium.org> Tested-by: Tomasz Michalec <tmichalec@google.com> Commit-Queue: Tomasz Michalec <tmichalec@google.com>
-rw-r--r--board/reef/board.c20
-rw-r--r--board/reef_it8320/board.c28
-rw-r--r--board/reef_mchp/board.c20
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,
+ },
}
};