summaryrefslogtreecommitdiff
path: root/zephyr/shim/src/bb_retimer_usb_mux.c
diff options
context:
space:
mode:
Diffstat (limited to 'zephyr/shim/src/bb_retimer_usb_mux.c')
-rw-r--r--zephyr/shim/src/bb_retimer_usb_mux.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/zephyr/shim/src/bb_retimer_usb_mux.c b/zephyr/shim/src/bb_retimer_usb_mux.c
index b0e3944528..c40068211e 100644
--- a/zephyr/shim/src/bb_retimer_usb_mux.c
+++ b/zephyr/shim/src/bb_retimer_usb_mux.c
@@ -1,13 +1,18 @@
-/* Copyright 2022 The ChromiumOS Authors
+/* Copyright 2022 The ChromiumOS Authors.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
+#include <zephyr/devicetree.h>
+#include <zephyr/sys/util_macro.h>
#include "usb_mux.h"
#include "usbc/usb_muxes.h"
-#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)
@@ -30,3 +35,5 @@ 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) */