summaryrefslogtreecommitdiff
path: root/driver/usb_mux/anx7451.h
diff options
context:
space:
mode:
authorRob Barnes <robbarnes@google.com>2021-04-27 06:44:55 -0600
committerCommit Bot <commit-bot@chromium.org>2021-04-27 22:42:35 +0000
commitda02ed5aace26a2abe545daaede8a18a100cc197 (patch)
treea33a181896aeb2e84048edb6f08d824f9ad0a2b8 /driver/usb_mux/anx7451.h
parentda8382de9741fad4af44dda39e59ec232f1ea66c (diff)
downloadchrome-ec-da02ed5aace26a2abe545daaede8a18a100cc197.tar.gz
ANX7451: Set upstream AUX FLIP
AUX flip control must be enabled. Otherwise alternate mode will not work on ANX7451 when cable is flipped. The USB registers use a separate i2c address that must be dynamically configured. Since there may be multiple ANX74** parts on a board, this address must be dynamically configured using a board callback. BUG=b:185276137 TEST=Display works when cable is flipped on B2 BRANCH=None Signed-off-by: Rob Barnes <robbarnes@google.com> Change-Id: I144131b2f53985d97e0be960e202366f726dd90b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2854120 Reviewed-by: Diana Z <dzigterman@chromium.org>
Diffstat (limited to 'driver/usb_mux/anx7451.h')
-rw-r--r--driver/usb_mux/anx7451.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/driver/usb_mux/anx7451.h b/driver/usb_mux/anx7451.h
index cf7a701f6c..7eefb6e79e 100644
--- a/driver/usb_mux/anx7451.h
+++ b/driver/usb_mux/anx7451.h
@@ -9,6 +9,8 @@
#ifndef __CROS_EC_USB_MUX_ANX7451_H
#define __CROS_EC_USB_MUX_ANX7451_H
+#include "usb_mux.h"
+
/* I2C interface addresses */
#define ANX7451_I2C_ADDR0_FLAGS 0x10
#define ANX7451_I2C_ADDR1_FLAGS 0x14
@@ -36,6 +38,21 @@
#define ANX7451_ULP_CFG_MODE_DP_EN BIT(1)
#define ANX7451_ULP_CFG_MODE_USB_EN BIT(0)
+/* Register to set USB I2C address, defaults to 0x29 (7-bit) */
+#define ANX7451_REG_USB_I2C_ADDR 0x38
+
+/* ANX7451 AUX FLIP control */
+#define ANX7451_REG_USB_AUX_FLIP_CTRL 0xA4
+#define ANX7451_USB_AUX_FLIP_EN 0x20
+
extern const struct usb_mux_driver anx7451_usb_mux_driver;
+/*
+ * ANX7451 uses a separate i2c address for USB configuration registers.
+ * This address is not controlled by address straps and defaults to 0x29.
+ * This address may conflict with other ANX74* parts. Implement
+ * board_anx7451_get_usb_i2c_addr to set a non-conflicting 7-bit address.
+ */
+uint16_t board_anx7451_get_usb_i2c_addr(const struct usb_mux *me);
+
#endif /* __CROS_EC_USB_MUX_ANX7451_H */