diff options
Diffstat (limited to 'board/nami/board.c')
-rw-r--r-- | board/nami/board.c | 14 |
1 files changed, 6 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); |