summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--zephyr/projects/corsola/i2c_krabby.dts4
-rw-r--r--zephyr/projects/corsola/src/krabby/usbc_config.c29
-rw-r--r--zephyr/projects/corsola/usbc_krabby.dts22
3 files changed, 24 insertions, 31 deletions
diff --git a/zephyr/projects/corsola/i2c_krabby.dts b/zephyr/projects/corsola/i2c_krabby.dts
index 13d5011b88..dd12e11f2c 100644
--- a/zephyr/projects/corsola/i2c_krabby.dts
+++ b/zephyr/projects/corsola/i2c_krabby.dts
@@ -36,11 +36,11 @@
i2c-port = <&i2c4>;
enum-name = "I2C_PORT_USB_C1";
};
- usb-mux0 {
+ i2c_usb_mux0: usb-mux0 {
i2c-port = <&i2c2>;
enum-name = "I2C_PORT_USB_MUX0";
};
- usb-mux1 {
+ i2c_usb_mux1: usb-mux1 {
i2c-port = <&i2c4>;
enum-name = "I2C_PORT_USB_MUX1";
};
diff --git a/zephyr/projects/corsola/src/krabby/usbc_config.c b/zephyr/projects/corsola/src/krabby/usbc_config.c
index dec82715a2..73ecd2f7bd 100644
--- a/zephyr/projects/corsola/src/krabby/usbc_config.c
+++ b/zephyr/projects/corsola/src/krabby/usbc_config.c
@@ -165,35 +165,6 @@ int board_set_active_charge_port(int port)
return EC_SUCCESS;
}
-const struct usb_mux usbc0_virtual_mux = {
- .usb_port = 0,
- .driver = &virtual_usb_mux_driver,
- .hpd_update = &virtual_hpd_update,
-};
-const struct usb_mux usbc1_virtual_mux = {
- .usb_port = 1,
- .driver = &virtual_usb_mux_driver,
- .hpd_update = &virtual_hpd_update,
-};
-
-struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_MAX_COUNT] = {
- {
- .usb_port = 0,
- .i2c_port = I2C_PORT_USB_MUX0,
- .i2c_addr_flags = IT5205_I2C_ADDR1_FLAGS,
- .driver = &it5205_usb_mux_driver,
- .next_mux = &usbc0_virtual_mux,
- },
- {
- .usb_port = 1,
- .i2c_port = I2C_PORT_USB_MUX1,
- .i2c_addr_flags = TUSB1064_I2C_ADDR0_FLAGS,
- .driver = &tusb1064_usb_mux_driver,
- .hpd_update = &tusb1044_hpd_update,
- .next_mux = &usbc1_virtual_mux,
- },
-};
-
#ifdef CONFIG_USB_PD_VBUS_MEASURE_ADC_EACH_PORT
enum adc_channel board_get_vbus_adc(int port)
{
diff --git a/zephyr/projects/corsola/usbc_krabby.dts b/zephyr/projects/corsola/usbc_krabby.dts
index c0453f85ab..2156782dbc 100644
--- a/zephyr/projects/corsola/usbc_krabby.dts
+++ b/zephyr/projects/corsola/usbc_krabby.dts
@@ -29,6 +29,17 @@
status = "okay";
port = <&i2c_charger>;
};
+ usb-muxes = <&it5205_mux_0 &virtual_mux_0>;
+ };
+ port0-muxes {
+ it5205_mux_0: it5205-mux-0 {
+ compatible = "ite,it5205";
+ port = <&i2c_usb_mux0>;
+ i2c-addr-flags = "IT5205_I2C_ADDR1_FLAGS";
+ };
+ virtual_mux_0: virtual-mux-0 {
+ compatible = "cros-ec,usbc-mux-virtual";
+ };
};
port1@1 {
@@ -49,6 +60,17 @@
tcpc {
compatible = "ite,it8xxx2-tcpc";
};
+ usb-muxes = <&tusb1064_mux_1 &virtual_mux_1>;
+ };
+ port1-muxes {
+ tusb1064_mux_1: tusb1064-mux-1 {
+ compatible = "ti,tusb1064";
+ port = <&i2c_usb_mux1>;
+ i2c-addr-flags = "TUSB1064_I2C_ADDR0_FLAGS";
+ };
+ virtual_mux_1: virtual-mux-1 {
+ compatible = "cros-ec,usbc-mux-virtual";
+ };
};
};
};