diff options
author | Tomasz Michalec <tm@semihalf.com> | 2022-04-13 21:01:08 +0200 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-06-03 14:12:19 +0000 |
commit | 391778c18daad8a04529f8891e28ded0dbc1313b (patch) | |
tree | a17b2965167f042918cdb1dab04bb46139c30b81 | |
parent | 097913735beba1c64f73e601a769f404236ecb4e (diff) | |
download | chrome-ec-391778c18daad8a04529f8891e28ded0dbc1313b.tar.gz |
zephyr: Add choice for TUSB type in Kconfig
TUSB1064 USB-C mux driver can work only with one TUSB type at the same
time. Allowed types are TUSB1064. TUSB1044, and TUSB546. It makes sense
to introduce PLATFORM_EC_USB_MUX_TUSB_TYPE in Kconfig.usb_mux
BUG=none
TEST=zmake testall
BRANCH=none
Signed-off-by: Tomasz Michalec <tm@semihalf.com>
Change-Id: I7bc583811bce718451d137f09dbe5f20be963f3e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3579120
Reviewed-by: Keith Short <keithshort@chromium.org>
Tested-by: Tomasz Michalec <tmichalec@google.com>
Commit-Queue: Tomasz Michalec <tmichalec@google.com>
-rw-r--r-- | util/config_allowed.txt | 1 | ||||
-rw-r--r-- | zephyr/CMakeLists.txt | 4 | ||||
-rw-r--r-- | zephyr/Kconfig.usb_mux | 26 | ||||
-rw-r--r-- | zephyr/dts/bindings/usbc/mux/ti,tusb1064.yaml | 4 | ||||
-rw-r--r-- | zephyr/shim/include/config_chip.h | 11 |
5 files changed, 34 insertions, 12 deletions
diff --git a/util/config_allowed.txt b/util/config_allowed.txt index f1b2bdcd3e..0d85c5f9e6 100644 --- a/util/config_allowed.txt +++ b/util/config_allowed.txt @@ -985,7 +985,6 @@ CONFIG_USB_MUX_PI3USB31532 CONFIG_USB_MUX_PS8740 CONFIG_USB_MUX_PS8742 CONFIG_USB_MUX_PS8822 -CONFIG_USB_MUX_TUSB1064 CONFIG_USB_PAIRING CONFIG_USB_PD_3A_PORTS CONFIG_USB_PD_5V_EN_ACTIVE_LOW diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt index 4e31b380d9..cf2a9645ce 100644 --- a/zephyr/CMakeLists.txt +++ b/zephyr/CMakeLists.txt @@ -421,9 +421,11 @@ zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_USB_MUX_IT5205 "${PLATFORM_EC}/driver/usb_mux/it5205.c") zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_USB_MUX_PS8743 "${PLATFORM_EC}/driver/usb_mux/ps8743.c") +zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_USB_MUX_TUSB546 + "${PLATFORM_EC}/driver/usb_mux/tusb1064.c") zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_USB_MUX_TUSB1044 "${PLATFORM_EC}/driver/usb_mux/tusb1064.c") -zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_USB_MUX_TUSB546 +zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_USB_MUX_TUSB1064 "${PLATFORM_EC}/driver/usb_mux/tusb1064.c") zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_USB_MUX_VIRTUAL "${PLATFORM_EC}/driver/usb_mux/virtual.c") diff --git a/zephyr/Kconfig.usb_mux b/zephyr/Kconfig.usb_mux index e83190c34f..a0db4f666d 100644 --- a/zephyr/Kconfig.usb_mux +++ b/zephyr/Kconfig.usb_mux @@ -56,12 +56,12 @@ config PLATFORM_EC_USB_MUX_PS8743 High-Bit-Rate 2 (HBR2) redriver. It provides control of switching modes through either GPIO or I2C. -config PLATFORM_EC_USB_MUX_TUSB1044 - bool "TI TUSB1044 USB-C 10 Gbps Linear Redriver" +choice PLATFORM_EC_USB_MUX_TUSB_TYPE + prompt "Select the TUSB USB-C Redriver type" + optional help - This is a USB Type-C Alt Mode redriver. This supports USB 3.1 - Gen 2 and DisplayPort 1.4 as Alternate Mode. It Provides GPIO and - I2C Control for Channel Direction and Equalization. + There are three supported types of TUSB USB-C Redriver: TUSB546, + TUSB1044, and TUSB1064. config PLATFORM_EC_USB_MUX_TUSB546 bool "TI TUSB546 USB-C DP ALT Mode Linear Redriver Crosspoint Switch" @@ -69,6 +69,22 @@ config PLATFORM_EC_USB_MUX_TUSB546 This is a USB Type-C Alt Mode redriving switch supporting USB 3.1 data rates up to 5 Gbps and DisplayPort 1.4 up to 8.1 Gbps for downstream facing port. + +config PLATFORM_EC_USB_MUX_TUSB1044 + bool "TI TUSB1044 USB-C 10 Gbps Linear Redriver" + help + This is a USB Type-C Alt Mode redriver. This supports USB 3.1 + Gen 2 and DisplayPort 1.4 as Alternate Mode. It Provides GPIO and + I2C Control for Channel Direction and Equalization. + +config PLATFORM_EC_USB_MUX_TUSB1064 + bool "TI TUSB1064 USB-C 10 Gbps Linear Redriver" + help + This is a USB Type-C Alt Mode redriver. This supports USB 3.1 + Gen 2 and DisplayPort 1.4. + +endchoice # PLATFORM_EC_USB_MUX_TUSB_TYPE + endif # PLATFORM_EC_USB_MUX endif # PLATFORM_EC_USBC diff --git a/zephyr/dts/bindings/usbc/mux/ti,tusb1064.yaml b/zephyr/dts/bindings/usbc/mux/ti,tusb1064.yaml index ff28ef9eb2..6c625459c1 100644 --- a/zephyr/dts/bindings/usbc/mux/ti,tusb1064.yaml +++ b/zephyr/dts/bindings/usbc/mux/ti,tusb1064.yaml @@ -3,8 +3,8 @@ # found in the LICENSE file. description: | - TI TUSB1064 and TUSB1044 USB-C MUX, device variant depends on - CONFIG_USB_MUX_TUSB1044 + TI TUSB546, TUSB1044, or TUSB1064 USB-C MUX, device variant depends on + CONFIG_PLATFORM_EC_USB_MUX_TUSB_TYPE Kconfig choice include: cros-ec,usbc-mux.yaml diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h index d3924e644d..079d8ed3e2 100644 --- a/zephyr/shim/include/config_chip.h +++ b/zephyr/shim/include/config_chip.h @@ -1673,14 +1673,19 @@ extern struct jump_data mock_jump_data; #define CONFIG_USB_MUX_PS8743 #endif +#undef CONFIG_USB_MUX_TUSB546 +#ifdef CONFIG_PLATFORM_EC_USB_MUX_TUSB546 +#define CONFIG_USB_MUX_TUSB546 +#endif + #undef CONFIG_USB_MUX_TUSB1044 #ifdef CONFIG_PLATFORM_EC_USB_MUX_TUSB1044 #define CONFIG_USB_MUX_TUSB1044 #endif -#undef CONFIG_USB_MUX_TUSB546 -#ifdef CONFIG_PLATFORM_EC_USB_MUX_TUSB546 -#define CONFIG_USB_MUX_TUSB546 +#undef CONFIG_USB_MUX_TUSB1064 +#ifdef CONFIG_PLATFORM_EC_USB_MUX_TUSB1064 +#define CONFIG_USB_MUX_TUSB1064 #endif #undef CONFIG_USB_MUX_VIRTUAL |