diff options
author | Caveh Jalali <caveh@chromium.org> | 2020-06-26 18:12:55 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-09-11 01:46:13 +0000 |
commit | 8e38c1c5966baf5ee4854ed53258b52b6fa0e963 (patch) | |
tree | 2658a9619bece00b8541b4f00e293c425738d830 /driver/tcpm/ps8xxx.c | |
parent | 0bda81934924a6646802abc6c9d14a0e4ab1f739 (diff) | |
download | chrome-ec-8e38c1c5966baf5ee4854ed53258b52b6fa0e963.tar.gz |
ps8xxx: add helper function to access alternate I2C pages
this provides a helper function for computing the I2C page address of
alternate I2C pages available on the ps8xxx family of chips.
BRANCH=none
BUG=b:158857815,b:159289062
TEST=buildall passes
Signed-off-by: Caveh Jalali <caveh@chromium.org>
Change-Id: I121ec9f2beaadf3e4e3c429d177fe38eb2976be8
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2271700
Reviewed-by: Keith Short <keithshort@chromium.org>
Commit-Queue: Keith Short <keithshort@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2392239
Tested-by: Devin Lu <Devin.Lu@quantatw.com>
Commit-Queue: Edward Hill <ecgh@chromium.org>
Diffstat (limited to 'driver/tcpm/ps8xxx.c')
-rw-r--r-- | driver/tcpm/ps8xxx.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/driver/tcpm/ps8xxx.c b/driver/tcpm/ps8xxx.c index d26bf69e1a..6b274cd405 100644 --- a/driver/tcpm/ps8xxx.c +++ b/driver/tcpm/ps8xxx.c @@ -211,8 +211,7 @@ static int ps8xxx_dci_disable(int port) int p1_addr; /* DCI registers are always accessible on PS8805 */ - p1_addr = tcpc_config[port].i2c_info.addr_flags - - (PS8751_I2C_ADDR1_FLAGS - PS8751_I2C_ADDR1_P1_FLAGS); + p1_addr = PS8751_P3_TO_P1_FLAGS(tcpc_config[port].i2c_info.addr_flags); return ps8xxx_addr_dci_disable(port, p1_addr, PS8805_P1_REG_MUX_USB_DCI_CFG); } @@ -237,8 +236,7 @@ static int ps8xxx_dci_disable(int port) PS8XXX_REG_I2C_DEBUGGING_ENABLE_ON); /* Disable Auto DCI */ - p1_addr = p3_addr - - (PS8751_I2C_ADDR1_FLAGS - PS8751_I2C_ADDR1_P1_FLAGS); + p1_addr = PS8751_P3_TO_P1_FLAGS(p3_addr); rv = ps8xxx_addr_dci_disable(port, p1_addr, PS8705_P1_REG_MUX_USB_DCI_CFG); |