diff options
-rw-r--r-- | zephyr/dts/bindings/usbc/mux/analogix,anx7483.yaml | 26 | ||||
-rw-r--r-- | zephyr/shim/include/usbc/anx7483_usb_mux.h | 22 | ||||
-rw-r--r-- | zephyr/shim/include/usbc/usb_muxes.h | 2 |
3 files changed, 50 insertions, 0 deletions
diff --git a/zephyr/dts/bindings/usbc/mux/analogix,anx7483.yaml b/zephyr/dts/bindings/usbc/mux/analogix,anx7483.yaml new file mode 100644 index 0000000000..9e4716d5d1 --- /dev/null +++ b/zephyr/dts/bindings/usbc/mux/analogix,anx7483.yaml @@ -0,0 +1,26 @@ +# Copyright 2022 The Chromium OS Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +description: | + Analogix re-timing MUX + +include: cros-ec,usbc-mux.yaml + +compatible: "analogix,anx7483" + +properties: + port: + type: phandle + required: true + description: phandle to the named i2c port + + i2c-addr-flags: + type: string + required: true + description: I2C address of chip + enum: + - ANX7483_I2C_ADDR0_FLAGS + - ANX7483_I2C_ADDR1_FLAGS + - ANX7483_I2C_ADDR2_FLAGS + - ANX7483_I2C_ADDR3_FLAGS diff --git a/zephyr/shim/include/usbc/anx7483_usb_mux.h b/zephyr/shim/include/usbc/anx7483_usb_mux.h new file mode 100644 index 0000000000..606928b016 --- /dev/null +++ b/zephyr/shim/include/usbc/anx7483_usb_mux.h @@ -0,0 +1,22 @@ +/* Copyright 2022 The Chromium OS Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#ifndef __ZEPHYR_SHIM_ANX7483_USB_MUX_H +#define __ZEPHYR_SHIM_ANX7483_USB_MUX_H + +#include "driver/retimer/anx7483_public.h" + +#define ANX7483_USB_MUX_COMPAT analogix_anx7483 + +#define USB_MUX_CONFIG_ANX7483(mux_id, port_id, idx) \ + { \ + USB_MUX_COMMON_FIELDS(mux_id, port_id, idx), \ + .driver = &anx7483_usb_retimer_driver, \ + .i2c_port = I2C_PORT(DT_PHANDLE(mux_id, port)), \ + .i2c_addr_flags = \ + DT_STRING_UPPER_TOKEN(mux_id, i2c_addr_flags), \ + } + +#endif /* __ZEPHYR_SHIM_ANX7483_USB_MUX_H */ diff --git a/zephyr/shim/include/usbc/usb_muxes.h b/zephyr/shim/include/usbc/usb_muxes.h index b3789cd6a1..e56e538a74 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/anx7483_usb_mux.h" #include "usbc/it5205_usb_mux.h" #include "usbc/tcpci_usb_mux.h" #include "usbc/tusb1064_usb_mux.h" @@ -19,6 +20,7 @@ * element of list has to have (compatible, config) format. */ #define USB_MUX_DRIVERS \ + (ANX7483_USB_MUX_COMPAT, USB_MUX_CONFIG_ANX7483), \ (IT5205_USB_MUX_COMPAT, USB_MUX_CONFIG_IT5205), \ (PS8XXX_USB_MUX_COMPAT, USB_MUX_CONFIG_TCPCI_TCPM), \ (TCPCI_TCPM_USB_MUX_COMPAT, USB_MUX_CONFIG_TCPCI_TCPM), \ |