diff options
-rw-r--r-- | board/madoo/board.c | 12 | ||||
-rw-r--r-- | board/madoo/board.h | 2 |
2 files changed, 12 insertions, 2 deletions
diff --git a/board/madoo/board.c b/board/madoo/board.c index 6be658ad9a..75e705cd76 100644 --- a/board/madoo/board.c +++ b/board/madoo/board.c @@ -494,13 +494,12 @@ const struct usb_mux usbc1_retimer = { .i2c_addr_flags = NB7V904M_I2C_ADDR0, .driver = &nb7v904m_usb_redriver_drv, }; -const struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_MAX_COUNT] = { +struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_MAX_COUNT] = { { .usb_port = 0, .i2c_port = I2C_PORT_USB_C0, .i2c_addr_flags = PI3USB3X532_I2C_ADDR0, .driver = &pi3usb3x532_usb_mux_driver, - .next_mux = &usbc0_retimer, }, { .usb_port = 1, @@ -511,6 +510,15 @@ const struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_MAX_COUNT] = { } }; +static void reconfigure_usbmux(void) +{ + if (system_get_board_version() < 2) { + CPRINTS("add redriver at usbc0"); + usb_muxes[0].next_mux = &usbc0_retimer; + } +} +DECLARE_HOOK(HOOK_INIT, reconfigure_usbmux, HOOK_PRIO_INIT_I2C+1); + uint16_t tcpc_get_alert_status(void) { uint16_t status = 0; diff --git a/board/madoo/board.h b/board/madoo/board.h index 522d99b322..3685a1017f 100644 --- a/board/madoo/board.h +++ b/board/madoo/board.h @@ -108,6 +108,8 @@ #define CONFIG_BATTERY_DEVICE_CHEMISTRY "LION" #define CONFIG_BATTERY_FUEL_GAUGE +#define CONFIG_USB_MUX_RUNTIME_CONFIG + #ifndef __ASSEMBLER__ #include "gpio_signal.h" |