summaryrefslogtreecommitdiff
path: root/board/brask/usbc_config.c
diff options
context:
space:
mode:
Diffstat (limited to 'board/brask/usbc_config.c')
-rw-r--r--board/brask/usbc_config.c81
1 files changed, 48 insertions, 33 deletions
diff --git a/board/brask/usbc_config.c b/board/brask/usbc_config.c
index caae5437a9..5cec791afc 100644
--- a/board/brask/usbc_config.c
+++ b/board/brask/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.
*/
@@ -32,8 +32,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[] = {
@@ -91,20 +91,29 @@ BUILD_ASSERT(ARRAY_SIZE(ppc_chips) == USBC_PORT_COUNT);
unsigned int ppc_cnt = ARRAY_SIZE(ppc_chips);
/* USBC mux configuration - Alder Lake includes internal mux */
-static const struct usb_mux usbc0_tcss_usb_mux = {
- .usb_port = USBC_PORT_C0,
- .driver = &virtual_usb_mux_driver,
- .hpd_update = &virtual_hpd_update,
+static const struct usb_mux_chain usbc0_tcss_usb_mux = {
+ .mux =
+ &(const struct usb_mux){
+ .usb_port = USBC_PORT_C0,
+ .driver = &virtual_usb_mux_driver,
+ .hpd_update = &virtual_hpd_update,
+ },
};
-static const struct usb_mux usbc1_tcss_usb_mux = {
- .usb_port = USBC_PORT_C1,
- .driver = &virtual_usb_mux_driver,
- .hpd_update = &virtual_hpd_update,
+static const struct usb_mux_chain usbc1_tcss_usb_mux = {
+ .mux =
+ &(const struct usb_mux){
+ .usb_port = USBC_PORT_C1,
+ .driver = &virtual_usb_mux_driver,
+ .hpd_update = &virtual_hpd_update,
+ },
};
-static const struct usb_mux usbc2_tcss_usb_mux = {
- .usb_port = USBC_PORT_C2,
- .driver = &virtual_usb_mux_driver,
- .hpd_update = &virtual_hpd_update,
+static const struct usb_mux_chain usbc2_tcss_usb_mux = {
+ .mux =
+ &(const struct usb_mux){
+ .usb_port = USBC_PORT_C2,
+ .driver = &virtual_usb_mux_driver,
+ .hpd_update = &virtual_hpd_update,
+ },
};
struct kb800x_control_t kb800x_control[] = {
@@ -124,29 +133,35 @@ struct kb800x_control_t kb800x_control[] = {
};
BUILD_ASSERT(ARRAY_SIZE(kb800x_control) == USBC_PORT_COUNT);
-const struct usb_mux usb_muxes[] = {
+const struct usb_mux_chain usb_muxes[] = {
[USBC_PORT_C0] = {
- .usb_port = USBC_PORT_C0,
- .driver = &bb_usb_retimer,
- .hpd_update = bb_retimer_hpd_update,
- .i2c_port = I2C_PORT_USB_C0_C2_MUX,
- .i2c_addr_flags = USBC_PORT_C0_BB_RETIMER_I2C_ADDR,
- .next_mux = &usbc0_tcss_usb_mux,
+ .mux = &(const struct usb_mux) {
+ .usb_port = USBC_PORT_C0,
+ .driver = &bb_usb_retimer,
+ .hpd_update = bb_retimer_hpd_update,
+ .i2c_port = I2C_PORT_USB_C0_C2_MUX,
+ .i2c_addr_flags = USBC_PORT_C0_BB_RETIMER_I2C_ADDR,
+ },
+ .next = &usbc0_tcss_usb_mux,
},
[USBC_PORT_C1] = {
- .usb_port = USBC_PORT_C1,
- .driver = &kb800x_usb_mux_driver,
- .i2c_port = I2C_PORT_USB_C1_MUX,
- .i2c_addr_flags = KB800X_I2C_ADDR0_FLAGS,
- .next_mux = &usbc1_tcss_usb_mux,
+ .mux = &(const struct usb_mux) {
+ .usb_port = USBC_PORT_C1,
+ .driver = &kb800x_usb_mux_driver,
+ .i2c_port = I2C_PORT_USB_C1_MUX,
+ .i2c_addr_flags = KB800X_I2C_ADDR0_FLAGS,
+ },
+ .next = &usbc1_tcss_usb_mux,
},
[USBC_PORT_C2] = {
- .usb_port = USBC_PORT_C2,
- .driver = &bb_usb_retimer,
- .hpd_update = bb_retimer_hpd_update,
- .i2c_port = I2C_PORT_USB_C0_C2_MUX,
- .i2c_addr_flags = USBC_PORT_C2_BB_RETIMER_I2C_ADDR,
- .next_mux = &usbc2_tcss_usb_mux,
+ .mux = &(const struct usb_mux) {
+ .usb_port = USBC_PORT_C2,
+ .driver = &bb_usb_retimer,
+ .hpd_update = bb_retimer_hpd_update,
+ .i2c_port = I2C_PORT_USB_C0_C2_MUX,
+ .i2c_addr_flags = USBC_PORT_C2_BB_RETIMER_I2C_ADDR,
+ },
+ .next = &usbc2_tcss_usb_mux,
},
};
BUILD_ASSERT(ARRAY_SIZE(usb_muxes) == USBC_PORT_COUNT);