diff options
author | Tomasz Michalec <tm@semihalf.com> | 2022-04-07 20:21:00 +0200 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-05-06 15:47:22 +0000 |
commit | 086009f55adcee29e4d3d8d8d0379d13a99ce946 (patch) | |
tree | bd3f7b923a71e4f1282c6617f95f1888b244f0c9 /include/usb_mux.h | |
parent | 52b10fc3261a28a5debae0f0e772bb67b3aee3b1 (diff) | |
download | chrome-ec-086009f55adcee29e4d3d8d8d0379d13a99ce946.tar.gz |
zephyr: move USB mux configuration into the device tree
Create a separated usb_muxes.c file in the shim layer to define the
usb_muxes array. Additional USB muxes in a chain are created in the same
file.
Common properties of the usb_mux DTS node are in cros-ec,usb-mux.yaml
file.
BUG=b:227757117
TEST=zmake testall
BRANCH=none
Signed-off-by: Tomasz Michalec <tm@semihalf.com>
Change-Id: I6cb26404b5cb44c6fce29f4176ebb6707af71d21
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3575157
Commit-Queue: Tomasz Michalec <tmichalec@google.com>
Reviewed-by: Keith Short <keithshort@chromium.org>
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Tested-by: Tomasz Michalec <tmichalec@google.com>
Diffstat (limited to 'include/usb_mux.h')
-rw-r--r-- | include/usb_mux.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/usb_mux.h b/include/usb_mux.h index e251d74f4c..13573f8b82 100644 --- a/include/usb_mux.h +++ b/include/usb_mux.h @@ -14,11 +14,23 @@ #include "usb_charge.h" #include "usb_pd.h" +/* + * If compiling with Zephyr, include the USB_MUX_FLAG_ definitions that are + * shared with device tree + */ +#ifdef CONFIG_ZEPHYR + +#include "dt-bindings/usbc_mux.h" + +#else /* !CONFIG_ZEPHYR */ + /* Flags used for usb_mux.flags */ #define USB_MUX_FLAG_NOT_TCPC BIT(0) /* TCPC/MUX device used only as MUX */ #define USB_MUX_FLAG_SET_WITHOUT_FLIP BIT(1) /* SET should not flip */ #define USB_MUX_FLAG_RESETS_IN_G3 BIT(2) /* Mux chip will reset in G3 */ +#endif /* CONFIG_ZEPHYR */ + /* * USB-C mux state * |