summaryrefslogtreecommitdiff
path: root/driver/usb_mux/amd_fp6.h
diff options
context:
space:
mode:
authorRob Barnes <robbarnes@google.com>2021-01-26 08:50:51 -0700
committerCommit Bot <commit-bot@chromium.org>2021-02-04 19:57:24 +0000
commit7cc4c6e351b346c650817d13b8fc9ef1d7f0b547 (patch)
tree8c0b7999bf39d7ff771051708f6f049d590bf58e /driver/usb_mux/amd_fp6.h
parent7a065d4e9b1b88586d146221df895ca92e33ba5a (diff)
downloadchrome-ec-7cc4c6e351b346c650817d13b8fc9ef1d7f0b547.tar.gz
guybrush: Add FP6 USB mux driver
FP6 USB mux driver is similar to the FP5 USB mux driver, but uses two addresses instead of an index to select the different USB ports. Also a low power bit has been added to the control register. Datasheet can be found in the bug. BUG=b:177057723 TEST=Build BRANCH=None Signed-off-by: Rob Barnes <robbarnes@google.com> Change-Id: I94a3db5f7d643a17dfdf89d721dd7f14cb75e402 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2654387 Reviewed-by: Diana Z <dzigterman@chromium.org>
Diffstat (limited to 'driver/usb_mux/amd_fp6.h')
-rw-r--r--driver/usb_mux/amd_fp6.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/driver/usb_mux/amd_fp6.h b/driver/usb_mux/amd_fp6.h
new file mode 100644
index 0000000000..b5fb661353
--- /dev/null
+++ b/driver/usb_mux/amd_fp6.h
@@ -0,0 +1,30 @@
+/* Copyright 2021 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.
+ *
+ * AMD FP6 USB/DP Mux.
+ */
+
+#ifndef __CROS_EC_USB_MUX_AMD_FP6_H
+#define __CROS_EC_USB_MUX_AMD_FP6_H
+
+#define AMD_FP6_C0_MUX_I2C_ADDR 0x5C
+#define AMD_FP6_C4_MUX_I2C_ADDR 0x52
+
+#define AMD_FP6_MUX_MODE_SAFE 0x0
+#define AMD_FP6_MUX_MODE_USB 0x1
+#define AMD_FP6_MUX_MODE_DP 0x2
+#define AMD_FP6_MUX_MODE_DOCK 0x3
+#define AMD_FP6_MUX_MODE_MASK GENMASK(1, 0)
+
+#define AMD_FP6_MUX_ORIENTATION BIT(4)
+#define AMD_FP6_MUX_LOW_POWER BIT(5)
+
+#define AMD_FP6_MUX_PORT_STATUS_OFFSET 6
+#define AMD_FP6_MUX_PORT_CMD_BUSY 0x0
+#define AMD_FP6_MUX_PORT_CMD_COMPLETE 0x1
+#define AMD_FP6_MUX_PORT_CMD_TIMEOUT 0x2
+
+#define AMD_FP6_MUX_PD_STATUS_READY BIT(5)
+
+#endif /* __CROS_EC_USB_MUX_AMD_FP6_H */