summaryrefslogtreecommitdiff
path: root/driver/retimer/tusb544.h
diff options
context:
space:
mode:
authorDiana Z <dzigterman@chromium.org>2020-02-14 12:56:04 -0700
committerCommit Bot <commit-bot@chromium.org>2020-02-25 23:03:49 +0000
commit2696c706b8b97f28dfc5448687f168e9225cc61f (patch)
tree839c0c998f507ee2ee0333547b686463f34d61e6 /driver/retimer/tusb544.h
parent1707e1ea83a9df8162c18321fc5a529d38f58870 (diff)
downloadchrome-ec-2696c706b8b97f28dfc5448687f168e9225cc61f.tar.gz
TUSB544: Add driver
Driver code for the TUSB544 redriver BRANCH=None BUG=b:149561847 TEST=builds Change-Id: I391d6d264ff9d326c2d45569124dd1366f892812 Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2062766 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'driver/retimer/tusb544.h')
-rw-r--r--driver/retimer/tusb544.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/driver/retimer/tusb544.h b/driver/retimer/tusb544.h
new file mode 100644
index 0000000000..7a1b0a82cd
--- /dev/null
+++ b/driver/retimer/tusb544.h
@@ -0,0 +1,49 @@
+/* Copyright 2020 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.
+ *
+ * TI TUSB544 USB Type-C Multi-Protocol Linear Redriver
+ */
+
+#ifndef __CROS_EC_USB_REDRIVER_TUSB544_H
+#define __CROS_EC_USB_REDRIVER_TUSB544_H
+
+#define TUSB544_ADDR_FLAGS0 0x44
+
+#define TUSB544_REG_GENERAL4 0x0A
+#define TUSB544_GEN4_CTL_SEL GENMASK(1, 0)
+#define TUSB544_GEN4_FLIP_SEL BIT(2)
+#define TUSB544_GEN4_HPDIN BIT(3)
+#define TUSB544_GEN4_EQ_OVRD BIT(4)
+#define TUSB544_GEN4_SWAP_SEL BIT(5)
+
+enum tusb544_ct_sel {
+ TUSB544_CTL_SEL_DISABLED,
+ TUSB544_CTL_SEL_USB_ONLY,
+ TUSB544_CTL_SEL_DP_ONLY,
+ TUSB544_CTL_SEL_DP_USB,
+};
+
+#define TUSB544_REG_GENERAL6 0x0C
+#define TUSB544_GEN6_DIR_SEL GENMASK(1, 0)
+
+enum tusb544_dir_sel {
+ TUSB544_DIR_SEL_USB_DP_SRC,
+ TUSB544_DIR_SEL_USB_DP_SNK,
+ TUSB544_DIR_SEL_CUSTOM_SRC,
+ TUSB544_DIS_SEL_CUSTOM_SNK,
+};
+
+/*
+ * Note: TUSB544 automatically snoops DP lanes to enable, but may be manually
+ * directed which lanes to turn on when snoop is disabled
+ */
+#define TUSB544_REG_DP4 0x13
+#define TUSB544_DP4_DP0_DISABLE BIT(0)
+#define TUSB544_DP4_DP1_DISABLE BIT(1)
+#define TUSB544_DP4_DP2_DISABLE BIT(2)
+#define TUSB544_DP4_DP3_DISABLE BIT(3)
+#define TUSB544_DP4_AUX_SBU_OVR GENMASK(5, 4)
+#define TUSB544_DP4_AUX_SNOOP_DISABLE BIT(7)
+
+#endif