diff options
author | Diana Z <dzigterman@chromium.org> | 2022-09-19 12:57:31 -0600 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-09-20 17:20:54 +0000 |
commit | b968ed738a004d70e7afb144fca1f63956ef0a09 (patch) | |
tree | 2061cd16c8fc2c8c8d8d92c7d84c1980e6610ed0 | |
parent | 3f70c7a15f3d5fc8c0ce71969cd9fa62153f37c8 (diff) | |
download | chrome-ec-b968ed738a004d70e7afb144fca1f63956ef0a09.tar.gz |
Zephyr: Add AMD FP6 mux driver to shim
Add the AMD FP6 mux driver into the shim so boards may use devicetree to
set up this mux.
BRANCH=None
BUG=b:244457125
TEST=zmake build skyrim
Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: I15b74a73c31d9d54597382cb34c5b45e98c20c55
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3905886
Reviewed-by: Keith Short <keithshort@chromium.org>
-rw-r--r-- | zephyr/dts/bindings/usbc/mux/amd,usbc-mux-amd-fp6.yaml | 9 | ||||
-rw-r--r-- | zephyr/shim/include/usbc/amd_fp6_usb_mux.h | 21 | ||||
-rw-r--r-- | zephyr/shim/include/usbc/usb_muxes.h | 4 |
3 files changed, 33 insertions, 1 deletions
diff --git a/zephyr/dts/bindings/usbc/mux/amd,usbc-mux-amd-fp6.yaml b/zephyr/dts/bindings/usbc/mux/amd,usbc-mux-amd-fp6.yaml new file mode 100644 index 0000000000..1ce1db82c7 --- /dev/null +++ b/zephyr/dts/bindings/usbc/mux/amd,usbc-mux-amd-fp6.yaml @@ -0,0 +1,9 @@ +# 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. + +description: USB-C AMD-FP6 mux + +include: ["i2c-device.yaml", "cros-ec,usbc-mux.yaml"] + +compatible: "amd,usbc-mux-amd-fp6" diff --git a/zephyr/shim/include/usbc/amd_fp6_usb_mux.h b/zephyr/shim/include/usbc/amd_fp6_usb_mux.h new file mode 100644 index 0000000000..a474a4eee4 --- /dev/null +++ b/zephyr/shim/include/usbc/amd_fp6_usb_mux.h @@ -0,0 +1,21 @@ +/* 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. + */ + +#ifndef __ZEPHYR_SHIM_AMD_FP6_USB_MUX_H +#define __ZEPHYR_SHIM_AMD_FP6_USB_MUX_H + +#include "usb_mux.h" + +#define AMD_FP6_USB_MUX_COMPAT amd_usbc_mux_amd_fp6 + +#define USB_MUX_CONFIG_AMD_FP6(mux_id) \ + { \ + USB_MUX_COMMON_FIELDS(mux_id), \ + .driver = &amd_fp6_usb_mux_driver, \ + .i2c_port = I2C_PORT_BY_DEV(mux_id), \ + .i2c_addr_flags = DT_REG_ADDR(mux_id), \ + } + +#endif /* __ZEPHYR_SHIM_AMD_FP6_USB_MUX_H */ diff --git a/zephyr/shim/include/usbc/usb_muxes.h b/zephyr/shim/include/usbc/usb_muxes.h index 9dce1a3aa5..4d95c51593 100644 --- a/zephyr/shim/include/usbc/usb_muxes.h +++ b/zephyr/shim/include/usbc/usb_muxes.h @@ -9,6 +9,7 @@ #include <zephyr/devicetree.h> #include <zephyr/sys/util_macro.h> #include "usb_mux.h" +#include "usbc/amd_fp6_usb_mux.h" #include "usbc/anx7447_usb_mux.h" #include "usbc/anx7483_usb_mux.h" #include "usbc/bb_retimer_usb_mux.h" @@ -24,7 +25,8 @@ * element of list has to have (compatible, config) format. */ #define USB_MUX_DRIVERS \ - (ANX7447_USB_MUX_COMPAT, USB_MUX_CONFIG_ANX7447), \ + (AMD_FP6_USB_MUX_COMPAT, USB_MUX_CONFIG_AMD_FP6), \ + (ANX7447_USB_MUX_COMPAT, USB_MUX_CONFIG_ANX7447), \ (ANX7483_USB_MUX_COMPAT, USB_MUX_CONFIG_ANX7483), \ (BB_RETIMER_USB_MUX_COMPAT, USB_MUX_CONFIG_BB_RETIMER), \ (IT5205_USB_MUX_COMPAT, USB_MUX_CONFIG_IT5205), \ |