diff options
-rw-r--r-- | zephyr/dts/bindings/usbc/mux/parade,ps8743.yaml | 25 | ||||
-rw-r--r-- | zephyr/shim/include/usbc/ps8743_usb_mux.h | 22 | ||||
-rw-r--r-- | zephyr/shim/include/usbc/usb_muxes.h | 2 |
3 files changed, 49 insertions, 0 deletions
diff --git a/zephyr/dts/bindings/usbc/mux/parade,ps8743.yaml b/zephyr/dts/bindings/usbc/mux/parade,ps8743.yaml new file mode 100644 index 0000000000..003f3ce13c --- /dev/null +++ b/zephyr/dts/bindings/usbc/mux/parade,ps8743.yaml @@ -0,0 +1,25 @@ +# 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: Parade PS8743 USB Type-C alternate mode MUX + +include: cros-ec,usbc-mux.yaml + +compatible: "parade,ps8743" + +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: + - PS8743_I2C_ADDR0_FLAG + - PS8743_I2C_ADDR1_FLAG + - PS8743_I2C_ADDR2_FLAG + - PS8743_I2C_ADDR3_FLAG diff --git a/zephyr/shim/include/usbc/ps8743_usb_mux.h b/zephyr/shim/include/usbc/ps8743_usb_mux.h new file mode 100644 index 0000000000..9630abe447 --- /dev/null +++ b/zephyr/shim/include/usbc/ps8743_usb_mux.h @@ -0,0 +1,22 @@ +/* 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_PS8743_USB_MUX_H +#define __ZEPHYR_SHIM_PS8743_USB_MUX_H + +#include "usb_mux/ps8743_public.h" + +#define PS8743_USB_MUX_COMPAT parade_ps8743 + +#define USB_MUX_CONFIG_PS8743(mux_id, port_id, idx) \ + { \ + USB_MUX_COMMON_FIELDS(mux_id, port_id, idx), \ + .driver = &ps8743_usb_mux_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_PS8743_USB_MUX_H */ diff --git a/zephyr/shim/include/usbc/usb_muxes.h b/zephyr/shim/include/usbc/usb_muxes.h index 40c9ad53c8..f704cad51e 100644 --- a/zephyr/shim/include/usbc/usb_muxes.h +++ b/zephyr/shim/include/usbc/usb_muxes.h @@ -12,6 +12,7 @@ #include "usbc/anx7483_usb_mux.h" #include "usbc/bb_retimer_usb_mux.h" #include "usbc/it5205_usb_mux.h" +#include "usbc/ps8743_usb_mux.h" #include "usbc/tcpci_usb_mux.h" #include "usbc/tusb1064_usb_mux.h" #include "usbc/virtual_usb_mux.h" @@ -24,6 +25,7 @@ (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), \ + (PS8743_USB_MUX_COMPAT, USB_MUX_CONFIG_PS8743), \ (PS8XXX_USB_MUX_COMPAT, USB_MUX_CONFIG_TCPCI_TCPM), \ (TCPCI_TCPM_USB_MUX_COMPAT, USB_MUX_CONFIG_TCPCI_TCPM), \ (TUSB1064_USB_MUX_COMPAT, USB_MUX_CONFIG_TUSB1064), \ |