summaryrefslogtreecommitdiff
path: root/driver/usb_mux/ps8822.h
diff options
context:
space:
mode:
authorScott Collyer <scollyer@google.com>2020-06-04 23:17:09 -0700
committerCommit Bot <commit-bot@chromium.org>2021-02-09 21:55:51 +0000
commitacdeee0e728c5b67ac495ccc9bf1afd746dd8a74 (patch)
treed20a8c05ff9c04ff77dfe2e3f2130bf4a3415fc3 /driver/usb_mux/ps8822.h
parentb76b012a2410c4d0e9cb679f921fec80fb6dcae2 (diff)
downloadchrome-ec-acdeee0e728c5b67ac495ccc9bf1afd746dd8a74.tar.gz
usb_mux: ps8822: Initial version of driver
This CL adds the driver for the PS8822 usb demux. Currently, the driver only supports the expected usb mux driver methods. It is expected that any EQ setting functions would be board specific, though more register definitions would need to be added to the .h file. BUG=b:175660576 BRANCH=None TEST=Connect on host port and then read back mode register to confirm that it's been set as expected. Signed-off-by: Scott Collyer <scollyer@google.com> Change-Id: Ic425ffe41f4653cee7f5500b081d7b5f6ad1a3df Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2247361 Commit-Queue: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>
Diffstat (limited to 'driver/usb_mux/ps8822.h')
-rw-r--r--driver/usb_mux/ps8822.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/driver/usb_mux/ps8822.h b/driver/usb_mux/ps8822.h
new file mode 100644
index 0000000000..d37e0600f5
--- /dev/null
+++ b/driver/usb_mux/ps8822.h
@@ -0,0 +1,39 @@
+/* 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.
+ *
+ * Parade PS8822
+ * USB Type-C Retiming Switch for USB Device / DisplayPort Sink
+ */
+
+#ifndef __CROS_EC_PS8822_H
+#define __CROS_EC_PS8822_H
+
+#include "usb_mux.h"
+
+#define PS8822_I2C_ADDR0_FLAG 0x10
+#define PS8822_I2C_ADDR1_FLAG 0x18
+#define PS8822_I2C_ADDR2_FLAG 0x58
+#define PS8822_I2C_ADDR3_FLAG 0x60
+
+/* Mode register for setting mux */
+#define PS8822_REG_MODE 0x01
+#define PS8822_MODE_ALT_DP_EN BIT(7)
+#define PS8822_MODE_USB_EN BIT(6)
+#define PS8822_MODE_FLIP BIT(5)
+#define PS8822_MODE_PIN_E BIT(4)
+
+#define PS8822_REG_CONFIG 0x02
+#define PS8822_CONFIG_HPD_IN_DIS BIT(7)
+#define PS8822_CONFIG_DP_PLUG BIT(6)
+
+#define PS8822_REG_DEV_ID1 0x06
+#define PS8822_REG_DEV_ID2 0x07
+#define PS8822_REG_DEV_ID3 0x08
+#define PS8822_REG_DEV_ID4 0x09
+#define PS8822_REG_DEV_ID5 0x0A
+#define PS8822_REG_DEV_ID6 0x0B
+
+#define PS8822_ID_LEN 6
+
+#endif /* __CROS_EC_PS8822_H */