From e2cbd8277107164b0ed2c5180ddfd4418d62cb5c Mon Sep 17 00:00:00 2001 From: Ben Chen Date: Fri, 13 Nov 2020 15:21:45 +0800 Subject: driver: add custom PS8802 I2C slave address Add custom PS8802 slave address, page offset define, and switch PS8802 slave address change function. Be sure the slave device was not conflicted. BUG=b:168761485, b:168761483 BRANCH=none TEST=make buildall. Change-Id: I4c02b574de7dc932cacfffae0cb695cecf8f1a22 Signed-off-by: Ben Chen Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2537517 Reviewed-by: Diana Z Reviewed-by: Aseda Aboagye --- driver/retimer/ps8802.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'driver/retimer/ps8802.h') diff --git a/driver/retimer/ps8802.h b/driver/retimer/ps8802.h index bdcf44dea8..4429db92ad 100644 --- a/driver/retimer/ps8802.h +++ b/driver/retimer/ps8802.h @@ -15,6 +15,12 @@ */ #define PS8802_I2C_ADDR_FLAGS 0x08 +/* + * PS8802 uses 7-bit I2C addresses 0x28 to 0x37. + * Page 0 = 0x028, Page 1 = 0x29, Page 2 = 0x2A. + */ +#define PS8802_I2C_ADDR_FLAGS_CUSTOM 0x28 + /* * PAGE 0 Register Definitions */ @@ -64,6 +70,9 @@ #define PS8802_DPEQ_LEVEL_UP_21DB 0x08 #define PS8802_DPEQ_LEVEL_UP_MASK 0x0F +#define PS8802_P1_ADDR 0x0A +#define PS8802_ADDR_CFG 0xB0 +#define PS8802_I2C_SLAV_ADDR 0x50 extern const struct usb_mux_driver ps8802_usb_mux_driver; @@ -76,5 +85,6 @@ int ps8802_i2c_field_update8(const struct usb_mux *me, int page, int offset, uint8_t field_mask, uint8_t set_value); int ps8802_i2c_field_update16(const struct usb_mux *me, int page, int offset, uint16_t field_mask, uint16_t set_value); +int ps8802_chg_i2c_addr(int i2c_port); #endif /* __CROS_EC_USB_RETIMER_PS8802_H */ -- cgit v1.2.1