From da02ed5aace26a2abe545daaede8a18a100cc197 Mon Sep 17 00:00:00 2001 From: Rob Barnes Date: Tue, 27 Apr 2021 06:44:55 -0600 Subject: 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 Change-Id: I144131b2f53985d97e0be960e202366f726dd90b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2854120 Reviewed-by: Diana Z --- driver/usb_mux/anx7451.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'driver/usb_mux/anx7451.h') 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 */ -- cgit v1.2.1