diff options
author | Wai-Hong Tam <waihong@google.com> | 2020-01-22 11:21:51 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-09-11 01:46:11 +0000 |
commit | 0bda81934924a6646802abc6c9d14a0e4ab1f739 (patch) | |
tree | 4fd66076d6f02bcc49f414b36f77e022bb45336d | |
parent | 40a66c255c207c5ed9c156057790a52c18276adf (diff) | |
download | chrome-ec-0bda81934924a6646802abc6c9d14a0e4ab1f739.tar.gz |
PS8805: Do not enable and disable DCI registers
PS8805 is not like PS8751, which needs to rewrite the TCPC reg A0 bit 0
to enable the DCI registers. The DCI registers are always accessible.
Also there is a bug on firmware, like 0x8, 0xC, 0xD, that rewriting the
reg A0 bit 0 to 1 will make the TCPC I2C not accessible.
BRANCH=None
BUG=b:147772854
TEST=Verified on Trogdor, fw 0xC, 0xD, and 0xF, the TCPC I2C is
accessible.
Change-Id: Ie554d2b4022397801423fb3670305bf536b2cc20
Signed-off-by: Wai-Hong Tam <waihong@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2015641
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2392238
Tested-by: Devin Lu <Devin.Lu@quantatw.com>
Commit-Queue: Edward Hill <ecgh@chromium.org>
-rw-r--r-- | driver/tcpm/ps8xxx.c | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/driver/tcpm/ps8xxx.c b/driver/tcpm/ps8xxx.c index 0147739d02..d26bf69e1a 100644 --- a/driver/tcpm/ps8xxx.c +++ b/driver/tcpm/ps8xxx.c @@ -208,27 +208,13 @@ static int ps8xxx_dci_disable(int port) #ifdef CONFIG_USB_PD_TCPM_PS8805 static int ps8xxx_dci_disable(int port) { - int status, e; int p1_addr; - status = tcpc_write(port, PS8XXX_REG_I2C_DEBUGGING_ENABLE, - PS8XXX_REG_I2C_DEBUGGING_ENABLE_ON); - if (status != EC_SUCCESS) - return status; - + /* 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); - status = ps8xxx_addr_dci_disable(port, p1_addr, - PS8805_P1_REG_MUX_USB_DCI_CFG); - - e = tcpc_write(port, PS8XXX_REG_I2C_DEBUGGING_ENABLE, - PS8XXX_REG_I2C_DEBUGGING_ENABLE_OFF); - if (e != EC_SUCCESS) { - if (status == EC_SUCCESS) - status = e; - } - - return status; + return ps8xxx_addr_dci_disable(port, p1_addr, + PS8805_P1_REG_MUX_USB_DCI_CFG); } #endif /* CONFIG_USB_PD_TCPM_PS8805 */ |