diff options
author | xiong.huang <xiong.huang@bitland.corp-partner.google.com> | 2020-03-01 17:05:17 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-03-02 11:37:05 +0000 |
commit | 17a683695ac7106ff5f1d74af77ccacf313242a2 (patch) | |
tree | c78e634c6dc141eae317c41f5037a0e9ad224dc4 /board/kodama | |
parent | 7a24cedd6f815e359c0032b548950cf62b754fd9 (diff) | |
download | chrome-ec-17a683695ac7106ff5f1d74af77ccacf313242a2.tar.gz |
kodama: rewrite charger CHG_CTRL1 register
USB2.0 device cannot be recognized probabilistically when the smart
battery is activated with the adapter at the first time. It found
charger register CHG_CTRL1(0x11) is changed to 0x02 when disconnecting
the external device since the unstable Vbat. In fact, the normal value
should be 0x10.
Rewriting the charger CHG_CTRL1 register after jumping to RW.
BUG=b:150515707
TEST=ensure USB2.0 device can be recognized after the smart battery
is activated with the adapter at the first time.
BRANCH=kukui
Signed-off-by: Xiong Huang <xiong.huang@bitland.corp-partner.google.com>
Change-Id: Iccba1f81099575968faa26bd8686c5ede37a3f31
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2082291
Reviewed-by: Eric Yilun Lin <yllin@chromium.org>
Diffstat (limited to 'board/kodama')
-rw-r--r-- | board/kodama/board.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/board/kodama/board.c b/board/kodama/board.c index 03ecf1afe7..08a4eeeeae 100644 --- a/board/kodama/board.c +++ b/board/kodama/board.c @@ -229,8 +229,20 @@ int pd_snk_is_vbus_provided(int port) return rt946x_is_vbus_ready(); } +#define CHARGER_I2C_ADDR_FLAGS RT946X_ADDR_FLAGS + static void board_init(void) { +#ifdef SECTION_IS_RW + int val; + + i2c_read8(I2C_PORT_CHARGER, CHARGER_I2C_ADDR_FLAGS, + RT946X_REG_CHGCTRL1, &val); + val &= RT946X_MASK_OPA_MODE; + i2c_write8(I2C_PORT_CHARGER, CHARGER_I2C_ADDR_FLAGS, + RT946X_REG_CHGCTRL1, (val | RT946X_MASK_STAT_EN)); +#endif + /* If the reset cause is external, pulse PMIC force reset. */ if (system_get_reset_flags() == EC_RESET_FLAG_RESET_PIN) { gpio_set_level(GPIO_PMIC_FORCE_RESET_ODL, 0); |