summaryrefslogtreecommitdiff
path: root/baseboard/grunt/baseboard.c
diff options
context:
space:
mode:
Diffstat (limited to 'baseboard/grunt/baseboard.c')
-rw-r--r--baseboard/grunt/baseboard.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/baseboard/grunt/baseboard.c b/baseboard/grunt/baseboard.c
index 5ab7dc8d53..82bf063bf9 100644
--- a/baseboard/grunt/baseboard.c
+++ b/baseboard/grunt/baseboard.c
@@ -135,8 +135,6 @@ void tcpc_alert_event(enum gpio_signal signal)
void board_tcpc_init(void)
{
- int port;
-
/* Only reset TCPC if not sysjump */
if (!system_jumped_to_this_image())
board_reset_pd_mcu();
@@ -157,11 +155,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 + 1);
@@ -280,28 +275,31 @@ void board_reset_pd_mcu(void)
static uint32_t sku_id;
-static int ps8751_tune_mux(int port)
+static int ps8751_tune_mux(const struct usb_mux *me)
{
/* Tune USB mux registers for treeya's port 1 Rx measurement */
if ((sku_id >= 0xa0) && (sku_id <= 0xaf))
- mux_write(port, PS8XXX_REG_MUX_USB_C2SS_EQ, 0x40);
+ mux_write(me, PS8XXX_REG_MUX_USB_C2SS_EQ, 0x40);
return EC_SUCCESS;
}
-struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_MAX_COUNT] = {
+const struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_MAX_COUNT] = {
#ifdef VARIANT_GRUNT_TCPC_0_ANX3429
[USB_PD_PORT_ANX74XX] = {
+ .usb_port = USB_PD_PORT_ANX74XX,
.driver = &anx74xx_tcpm_usb_mux_driver,
.hpd_update = &anx74xx_tcpc_update_hpd_status,
},
#elif defined(VARIANT_GRUNT_TCPC_0_ANX3447)
[USB_PD_PORT_ANX74XX] = {
+ .usb_port = USB_PD_PORT_ANX74XX,
.driver = &anx7447_usb_mux_driver,
.hpd_update = &anx7447_tcpc_update_hpd_status,
},
#endif
[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,