diff options
Diffstat (limited to 'board/gimble/usbc_config.c')
-rw-r--r-- | board/gimble/usbc_config.c | 46 |
1 files changed, 26 insertions, 20 deletions
diff --git a/board/gimble/usbc_config.c b/board/gimble/usbc_config.c index e747ab0df9..feb123a525 100644 --- a/board/gimble/usbc_config.c +++ b/board/gimble/usbc_config.c @@ -1,4 +1,4 @@ -/* Copyright 2021 The Chromium OS Authors. All rights reserved. +/* Copyright 2021 The ChromiumOS Authors * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ @@ -34,8 +34,8 @@ #include "usb_pd.h" #include "usb_pd_tcpm.h" -#define CPRINTF(format, args...) cprintf(CC_USBPD, format, ## args) -#define CPRINTS(format, args...) cprints(CC_USBPD, format, ## args) +#define CPRINTF(format, args...) cprintf(CC_USBPD, format, ##args) +#define CPRINTS(format, args...) cprints(CC_USBPD, format, ##args) /* USBC TCPC configuration */ const struct tcpc_config_t tcpc_config[] = { @@ -88,26 +88,33 @@ unsigned int ppc_cnt = ARRAY_SIZE(ppc_chips); * to the virtual_usb_mux_driver so the AP gets notified of mux changes * and updates the TCSS configuration on state changes. */ -static const struct usb_mux usbc1_usb3_db_retimer = { - .usb_port = USBC_PORT_C1, - .driver = &tcpci_tcpm_usb_mux_driver, - .hpd_update = &ps8xxx_tcpc_update_hpd_status, - .next_mux = NULL, +static const struct usb_mux_chain usbc1_usb3_db_retimer = { + .mux = + &(const struct usb_mux){ + .usb_port = USBC_PORT_C1, + .driver = &tcpci_tcpm_usb_mux_driver, + .hpd_update = &ps8xxx_tcpc_update_hpd_status, + }, + .next = NULL, }; /* USBC mux configuration - Alder Lake includes internal mux */ -const struct usb_mux usb_muxes[] = { +const struct usb_mux_chain usb_muxes[] = { [USBC_PORT_C0] = { - .usb_port = USBC_PORT_C0, - .driver = &virtual_usb_mux_driver, - .hpd_update = &virtual_hpd_update, + .mux = &(const struct usb_mux) { + .usb_port = USBC_PORT_C0, + .driver = &virtual_usb_mux_driver, + .hpd_update = &virtual_hpd_update, + }, }, [USBC_PORT_C1] = { - /* PS8815 DB */ - .usb_port = USBC_PORT_C1, - .driver = &virtual_usb_mux_driver, - .hpd_update = &virtual_hpd_update, - .next_mux = &usbc1_usb3_db_retimer, + .mux = &(const struct usb_mux) { + /* PS8815 DB */ + .usb_port = USBC_PORT_C1, + .driver = &virtual_usb_mux_driver, + .hpd_update = &virtual_hpd_update, + }, + .next = &usbc1_usb3_db_retimer, }, }; BUILD_ASSERT(ARRAY_SIZE(usb_muxes) == USBC_PORT_COUNT); @@ -160,12 +167,11 @@ void board_reset_pd_mcu(void) if (battery_hw_present()) gpio_set_level(GPIO_USB_C1_RT_RST_R_ODL, 0); - msleep(GENERIC_MAX(PS8XXX_RESET_DELAY_MS, - PS8815_PWR_H_RST_H_DELAY_MS)); + msleep(GENERIC_MAX(PS8XXX_RESET_DELAY_MS, PS8815_PWR_H_RST_H_DELAY_MS)); gpio_set_level(GPIO_USB_C0_TCPC_RST_ODL, 1); gpio_set_level(GPIO_USB_C1_RT_RST_R_ODL, 1); - + /* wait for chips to come up */ msleep(PS8815_FW_INIT_DELAY_MS); } |