summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjeffrey_lin <jeffrey_lin@pegatron.corp-partner.google.com>2022-07-07 10:03:45 +0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-07-08 03:31:35 +0000
commitbdb3302723e1f3beed8abe77dc2d84a920a87100 (patch)
tree0d63eb1082983d6e375904c01a5fc3f80ba536a5
parent0e3fa7b8aa981586db664c5a83912759ad31d1ee (diff)
downloadchrome-ec-bdb3302723e1f3beed8abe77dc2d84a920a87100.tar.gz
tentacruel: add ps8743 device binding
add PS8743 USBC MUX device binding BUG=b:237955258 TEST=enable on tentacruel BRANCH=none Signed-off-by: jeffrey_lin <jeffrey_lin@pegatron.corp-partner.google.com> Change-Id: Ie059aabb362da5fe390155dda2907c03cbfca176 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3750261 Reviewed-by: Eric Yilun Lin <yllin@google.com>
-rw-r--r--zephyr/dts/bindings/usbc/mux/parade,ps8743.yaml25
-rw-r--r--zephyr/shim/include/usbc/ps8743_usb_mux.h22
-rw-r--r--zephyr/shim/include/usbc/usb_muxes.h2
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), \