diff options
author | Ben Chen <ben.chen2@quanta.corp-partner.google.com> | 2020-11-13 15:21:45 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-11-20 03:20:15 +0000 |
commit | e2cbd8277107164b0ed2c5180ddfd4418d62cb5c (patch) | |
tree | 4ddf49c0a754511dfcb4c21df9a4374b2e7158b1 /driver/retimer/ps8802.c | |
parent | 49f18a1879e452630b89304c14156c7fd22a3605 (diff) | |
download | chrome-ec-e2cbd8277107164b0ed2c5180ddfd4418d62cb5c.tar.gz |
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 <ben.chen2@quanta.corp-partner.google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2537517
Reviewed-by: Diana Z <dzigterman@chromium.org>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'driver/retimer/ps8802.c')
-rw-r--r-- | driver/retimer/ps8802.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/driver/retimer/ps8802.c b/driver/retimer/ps8802.c index cb81b84f4e..190bed8873 100644 --- a/driver/retimer/ps8802.c +++ b/driver/retimer/ps8802.c @@ -273,3 +273,18 @@ const struct usb_mux_driver ps8802_usb_mux_driver = { .set = ps8802_set_mux, .get = ps8802_get_mux, }; + +/* + * If PS8802 I2c slave address was conflicted, change + * the I2c slave address in page 0x0A, offset 0xB0 + * switch to 0x50 slave address + */ +int ps8802_chg_i2c_addr(int i2c_port) +{ + int rv; + + rv = i2c_write8(i2c_port, + PS8802_P1_ADDR, PS8802_ADDR_CFG, PS8802_I2C_SLAV_ADDR); + + return rv; +} |