usb: typec: tcpm: husb311: disable i2c timeout reset function

According to the description of the I2C_RESET(0x9E) register in
the husb311 datasheet, the main configuration is enable/disable
i2c timeout reset function(bit[7]) and i2c timeout time(bit[3:0]).

If the i2c timeout reset function is enabled, the husb311 will perform
a soft reset in some cases, such as system hibernation, and close the
i2c bus (SCL and SDA are low at the same time). So we disable the i2c
timeout reset function.

Change-Id: Id9169f3ecf65725a959aadda9d2f8f60f20c87a3
Signed-off-by: Wang Jie <dave.wang@rock-chips.com>
This commit is contained in:
Wang Jie
2022-02-08 09:40:41 +08:00
committed by Tao Huang
parent d2cf002d8f
commit 0bec4db01a

View File

@@ -19,7 +19,6 @@
#define HUSB311_VID 0x2E99
#define HUSB311_PID 0x0311
#define HUSB311_TCPC_POWER 0x90
#define HUSB311_TCPC_I2C_RESET 0x9E
#define HUSB311_TCPC_SOFTRESET 0xA0
#define HUSB311_TCPC_FILTER 0xA1
#define HUSB311_TCPC_TDRP 0xA2
@@ -70,10 +69,8 @@ static int husb311_init(struct tcpci *tcpci, struct tcpci_data *tdata)
int ret;
struct husb311_chip *chip = tdata_to_husb311(tdata);
/* I2C reset : (val + 1) * 12.5ms */
ret = husb311_write8(chip, HUSB311_TCPC_I2C_RESET, 0x8F);
/* tTCPCfilter : (26.7 * val) us */
ret |= husb311_write8(chip, HUSB311_TCPC_FILTER, 0x0F);
ret = husb311_write8(chip, HUSB311_TCPC_FILTER, 0x0F);
/* tDRP : (51.2 + 6.4 * val) ms */
ret |= husb311_write8(chip, HUSB311_TCPC_TDRP, 0x04);
/* dcSRC.DRP : 33% */