summaryrefslogtreecommitdiff
path: root/zephyr/shim/include/usbc/tcpc_ps8xxx.h
diff options
context:
space:
mode:
authorTing Shen <phoenixshen@google.com>2022-03-14 17:49:53 +0800
committerCommit Bot <commit-bot@chromium.org>2022-03-21 13:50:39 +0000
commit82e218b9954da59dc3bb886e097d7e11f23bdf51 (patch)
tree96f5ee60a3cb70c722ba0b703eba8400a9d2c058 /zephyr/shim/include/usbc/tcpc_ps8xxx.h
parent88970330f8610c5cd26ea88f8a7b0ddc7da83565 (diff)
downloadchrome-ec-82e218b9954da59dc3bb886e097d7e11f23bdf51.tar.gz
zephyr: add common tcpc_config shim
Move the ps8xxx tcpc_config definition to a common file, and add support for two more drivers: it8xxx2 and tcpci. BUG=b:220814055 TEST=1) Pass the device tree unit test in CL:3521085 2) zmake configure -b {krabby,herobrine} BRANCH=none Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: I4e646e90fc6529f1d80cb94db54503cea50ba8fd Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3521086 Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
Diffstat (limited to 'zephyr/shim/include/usbc/tcpc_ps8xxx.h')
-rw-r--r--zephyr/shim/include/usbc/tcpc_ps8xxx.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/zephyr/shim/include/usbc/tcpc_ps8xxx.h b/zephyr/shim/include/usbc/tcpc_ps8xxx.h
new file mode 100644
index 0000000000..786d6c5e4d
--- /dev/null
+++ b/zephyr/shim/include/usbc/tcpc_ps8xxx.h
@@ -0,0 +1,20 @@
+/* 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.
+ */
+
+#include <devicetree.h>
+#include "driver/tcpm/ps8xxx_public.h"
+
+#define PS8XXX_COMPAT parade_ps8xxx
+
+#define TCPC_CONFIG_PS8XXX(id) \
+ { \
+ .bus_type = EC_BUS_TYPE_I2C, \
+ .i2c_info = { \
+ .port = I2C_PORT(DT_PHANDLE(id, port)), \
+ .addr_flags = DT_STRING_UPPER_TOKEN( \
+ id, i2c_addr_flags), \
+ }, \
+ .drv = &ps8xxx_tcpm_drv, \
+ },