diff options
author | Tomasz Michalec <tm@semihalf.com> | 2022-04-07 20:34:56 +0200 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-05-06 15:47:44 +0000 |
commit | 25d4c01f9d1b2f891901a9ab1c670dce8d64542d (patch) | |
tree | 159360f5717dfabb4c7f999eff15c80dcc2bee0e | |
parent | c5faba48e6ca3e3cb98db8abc896cd7ff4aeae44 (diff) | |
download | chrome-ec-25d4c01f9d1b2f891901a9ab1c670dce8d64542d.tar.gz |
zephyr: move Herobrine USB mux configuration into the DTS
Move Herobrine, Hoglin, and Villager USB mux configuration into
the devicetree.
BUG=b:227757117
TEST=zmake testall
TEST=check if usb_muxes structure is correct using gdb:
gdb ./build/zephyr/{herobrine|hoglin|villager}/output/zephyr.ro.elf
p usb_muxes
BRANCH=none
Signed-off-by: Tomasz Michalec <tm@semihalf.com>
Change-Id: I6fa1483e9f536a503e85e61be0b21119c9c4d3b4
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3575158
Tested-by: Tomasz Michalec <tmichalec@google.com>
Reviewed-by: Keith Short <keithshort@chromium.org>
Commit-Queue: Tomasz Michalec <tmichalec@google.com>
-rw-r--r-- | zephyr/projects/herobrine/src/usbc_config.c | 20 | ||||
-rw-r--r-- | zephyr/projects/herobrine/usbc_herobrine.dts | 8 | ||||
-rw-r--r-- | zephyr/projects/herobrine/usbc_hoglin.dts | 8 | ||||
-rw-r--r-- | zephyr/projects/herobrine/usbc_villager.dts | 8 |
4 files changed, 24 insertions, 20 deletions
diff --git a/zephyr/projects/herobrine/src/usbc_config.c b/zephyr/projects/herobrine/src/usbc_config.c index f1005335e5..e848e50fd7 100644 --- a/zephyr/projects/herobrine/src/usbc_config.c +++ b/zephyr/projects/herobrine/src/usbc_config.c @@ -119,26 +119,6 @@ enum ec_status charger_profile_override_set_param(uint32_t param, return EC_RES_INVALID_PARAM; } -/* - * Port-0/1 USB mux driver. - * - * The USB mux is handled by TCPC chip and the HPD update is through a GPIO - * to AP. But the TCPC chip is also needed to know the HPD status; otherwise, - * the mux misbehaves. - */ -const struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_MAX_COUNT] = { - { - .usb_port = 0, - .driver = &tcpci_tcpm_usb_mux_driver, - .hpd_update = &ps8xxx_tcpc_update_hpd_status, - }, - { - .usb_port = 1, - .driver = &tcpci_tcpm_usb_mux_driver, - .hpd_update = &ps8xxx_tcpc_update_hpd_status, - } -}; - /* Initialize board USC-C things */ static void board_init_usbc(void) { diff --git a/zephyr/projects/herobrine/usbc_herobrine.dts b/zephyr/projects/herobrine/usbc_herobrine.dts index 381b4f8346..153dc44f89 100644 --- a/zephyr/projects/herobrine/usbc_herobrine.dts +++ b/zephyr/projects/herobrine/usbc_herobrine.dts @@ -35,6 +35,10 @@ status = "okay"; port = <&i2c_charger>; }; + usb-muxes = <&usb_mux_0>; + }; + usb_mux_0: usb-mux-0 { + compatible = "parade,usbc-mux-ps8xxx"; }; port1@1 { @@ -59,6 +63,10 @@ port = <&i2c_tcpc1>; i2c-addr-flags = "PS8XXX_I2C_ADDR1_FLAGS"; }; + usb-muxes = <&usb_mux_1>; + }; + usb_mux_1: usb-mux-1 { + compatible = "parade,usbc-mux-ps8xxx"; }; }; usbc-alt-chips { diff --git a/zephyr/projects/herobrine/usbc_hoglin.dts b/zephyr/projects/herobrine/usbc_hoglin.dts index 8f712746f1..68b262f8ef 100644 --- a/zephyr/projects/herobrine/usbc_hoglin.dts +++ b/zephyr/projects/herobrine/usbc_hoglin.dts @@ -36,6 +36,10 @@ status = "okay"; port = <&i2c_charger>; }; + usb-muxes = <&usb_mux_0>; + }; + usb_mux_0: usb-mux-0 { + compatible = "parade,usbc-mux-ps8xxx"; }; port1@1 { @@ -61,6 +65,10 @@ port = <&i2c_tcpc1>; i2c-addr-flags = "PS8XXX_I2C_ADDR2_FLAGS"; }; + usb-muxes = <&usb_mux_1>; + }; + usb_mux_1: usb-mux-1 { + compatible = "parade,usbc-mux-ps8xxx"; }; }; }; diff --git a/zephyr/projects/herobrine/usbc_villager.dts b/zephyr/projects/herobrine/usbc_villager.dts index a105d95713..90dd88412c 100644 --- a/zephyr/projects/herobrine/usbc_villager.dts +++ b/zephyr/projects/herobrine/usbc_villager.dts @@ -36,6 +36,10 @@ status = "okay"; port = <&i2c_charger>; }; + usb-muxes = <&usb_mux_0>; + }; + usb_mux_0: usb-mux-0 { + compatible = "parade,usbc-mux-ps8xxx"; }; port1@1 { @@ -61,6 +65,10 @@ port = <&i2c_tcpc1>; i2c-addr-flags = "PS8XXX_I2C_ADDR1_FLAGS"; }; + usb-muxes = <&usb_mux_1>; + }; + usb_mux_1: usb-mux-1 { + compatible = "parade,usbc-mux-ps8xxx"; }; }; }; |