summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio Baltieri <fabiobaltieri@google.com>2022-11-24 15:54:58 +0000
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-11-30 20:19:27 +0000
commitd6d1090a803313be6eaed5099a5fc3d6323db217 (patch)
tree7a2717d06852c752b32fd5f06c7fc84eb570982a
parent2888f43dfd8b1b58021ad650888efd5af641641c (diff)
downloadchrome-ec-d6d1090a803313be6eaed5099a5fc3d6323db217.tar.gz
zephyr: usb_muxes, bb_retimer: fix kconfig dependencies
Fix Kconfig dependencies for usb_muxes and bb_retimer_usb_mux so that we can safely drop the compiler guards and the source is included only if the necessary structures are defined. BRANCH=none BUG=none TEST=cq dry run Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: I9ab501a81549ef10b6db7f221517ff7cce619a8f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4054625 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
-rw-r--r--zephyr/Kconfig.retimer4
-rw-r--r--zephyr/Kconfig.usb_mux1
-rw-r--r--zephyr/shim/src/bb_retimer_usb_mux.c8
-rw-r--r--zephyr/shim/src/usb_muxes.c8
4 files changed, 5 insertions, 16 deletions
diff --git a/zephyr/Kconfig.retimer b/zephyr/Kconfig.retimer
index 9ce134dc13..3a052f1f1a 100644
--- a/zephyr/Kconfig.retimer
+++ b/zephyr/Kconfig.retimer
@@ -6,6 +6,8 @@ if PLATFORM_EC_USBC
config PLATFORM_EC_USBC_RETIMER_INTEL_BB
bool "Support Intel Burnside Bridge retimer"
+ depends on PLATFORM_EC_USB_MUX
+ depends on DT_HAS_INTEL_JHL8040R_ENABLED
select PLATFORM_EC_USB_PD_USB4
select PLATFORM_EC_USB_PD_TBT_COMPAT_MODE
help
@@ -29,6 +31,8 @@ config PLATFORM_EC_USBC_RETIMER_INTEL_BB
config PLATFORM_EC_USBC_RETIMER_INTEL_HB
bool "Support Intel Hayden Bridge retimer"
+ depends on PLATFORM_EC_USB_MUX
+ depends on DT_HAS_INTEL_JHL8040R_ENABLED
select PLATFORM_EC_USB_PD_USB4
select PLATFORM_EC_USB_PD_TBT_COMPAT_MODE
help
diff --git a/zephyr/Kconfig.usb_mux b/zephyr/Kconfig.usb_mux
index 6f4e31a2cf..376a28f9b2 100644
--- a/zephyr/Kconfig.usb_mux
+++ b/zephyr/Kconfig.usb_mux
@@ -7,6 +7,7 @@ if PLATFORM_EC_USBC
menuconfig PLATFORM_EC_USB_MUX
bool "USB muxes"
default y
+ depends on DT_HAS_CROS_EC_USB_MUX_CHAIN_ENABLED
help
Enables support for USB muxes. These allow multiplexing
diff --git a/zephyr/shim/src/bb_retimer_usb_mux.c b/zephyr/shim/src/bb_retimer_usb_mux.c
index 2f45a5ee0f..b0e3944528 100644
--- a/zephyr/shim/src/bb_retimer_usb_mux.c
+++ b/zephyr/shim/src/bb_retimer_usb_mux.c
@@ -9,12 +9,6 @@
#include <zephyr/devicetree.h>
#include <zephyr/sys/util_macro.h>
-/**
- * This prevents creating struct usb_mux bb_controls[] for platforms that didn't
- * migrate USB mux configuration to DTS yet.
- */
-#if DT_HAS_COMPAT_STATUS_OKAY(cros_ec_usb_mux_chain)
-
BB_RETIMER_CHECK_SAME_CONTROLS(BB_RETIMER_INSTANCES_LIST)
/**
@@ -36,5 +30,3 @@ BB_RETIMER_CHECK_SAME_CONTROLS(BB_RETIMER_INSTANCES_LIST)
BB_CONTROLS_CONST struct bb_usb_control bb_controls[] = {
USB_MUX_BB_RETIMERS_CONTROLS_ARRAY
};
-
-#endif /* #if DT_HAS_COMPAT_STATUS_OKAY(cros_ec_usb_mux_chain) */
diff --git a/zephyr/shim/src/usb_muxes.c b/zephyr/shim/src/usb_muxes.c
index af86cec0cd..b3854e2ca8 100644
--- a/zephyr/shim/src/usb_muxes.c
+++ b/zephyr/shim/src/usb_muxes.c
@@ -10,12 +10,6 @@
#include <zephyr/sys/util_macro.h>
/**
- * This prevents creating struct usb_mux usb_muxes[] for platforms that didn't
- * migrate USB mux configuration to DTS yet.
- */
-#if DT_HAS_COMPAT_STATUS_OKAY(cros_ec_usb_mux_chain)
-
-/**
* @brief Check if @p mux_id is not part of @p chain_id or if @p chain_id USBC
* port is the same as @p mux_port. Result ends with && to construct
* logical expression using FOREACH macro.
@@ -96,5 +90,3 @@ BUILD_ASSERT(ARRAY_SIZE(usb_muxes) == CONFIG_USB_PD_PORT_MAX_COUNT);
* MAYBE_CONST struct usb_mux USB_MUX_NODE_<node_id> = { ... };
*/
USB_MUX_FOREACH_MUX(USB_MUX_DEFINE)
-
-#endif /* #if DT_HAS_COMPAT_STATUS_OKAY(cros_ec_usb_mux_chain) */