summaryrefslogtreecommitdiff
path: root/driver/usb_mux_it5205.h
diff options
context:
space:
mode:
authorDino Li <Dino.Li@ite.com.tw>2017-10-31 14:59:50 +0800
committerchrome-bot <chrome-bot@chromium.org>2017-10-31 21:49:24 -0700
commit73d0ed0b794b13ceff5620b5c15ba7a3760d1f35 (patch)
tree3083fa0ba743eb5d70e90c15394c7d479f51c756 /driver/usb_mux_it5205.h
parentb979c8ade3c46d67ef739bfe22361b8fc5db6b34 (diff)
downloadchrome-ec-73d0ed0b794b13ceff5620b5c15ba7a3760d1f35.tar.gz
driver: add IT5205 mux driver
Add support the ITE IT5205 Type-C USB alternate mode mux. BRANCH=none BUG=none TEST=1. Successfully verify chip ID. 2. Verify set_mux() and get_mux() functions set and return consistent values. 3. The mux control register setting as expected after set_mux(). Change-Id: I9ff066dc9e74683df1371b70290e2aeaa86cb96b Signed-off-by: Dino Li <Dino.Li@ite.com.tw> Reviewed-on: https://chromium-review.googlesource.com/741211 Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'driver/usb_mux_it5205.h')
-rw-r--r--driver/usb_mux_it5205.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/driver/usb_mux_it5205.h b/driver/usb_mux_it5205.h
new file mode 100644
index 0000000000..0cebeed71a
--- /dev/null
+++ b/driver/usb_mux_it5205.h
@@ -0,0 +1,32 @@
+/* Copyright 2017 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.
+ *
+ * ITE IT5205 Type-C USB alternate mode mux.
+ */
+
+#ifndef __CROS_EC_USB_MUX_IT5205_H
+#define __CROS_EC_USB_MUX_IT5205_H
+
+/* 8 bit i2c slave address is 0xb0 or 0x90 depends on address setting pin. */
+
+/* Chip ID registers */
+#define IT5205_REG_CHIP_ID3 0x4
+#define IT5205_REG_CHIP_ID2 0x5
+#define IT5205_REG_CHIP_ID1 0x6
+#define IT5205_REG_CHIP_ID0 0x7
+
+/* MUX power down register */
+#define IT5205_REG_MUXPDR 0x10
+#define IT5205_MUX_POWER_DOWN (1 << 0)
+
+/* MUX control register */
+#define IT5205_REG_MUXCR 0x11
+#define IT5205_POLARITY_INVERTED (1 << 4)
+
+#define IT5205_DP_USB_CTRL_MASK 0x0f
+#define IT5205_DP 0x0f
+#define IT5205_DP_USB 0x03
+#define IT5205_USB 0x07
+
+#endif /* __CROS_EC_USB_MUX_IT5205_H */