diff options
author | Diana Z <dzigterman@chromium.org> | 2020-08-12 13:29:10 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-08-13 19:21:33 +0000 |
commit | b79fda068026092f4c2eb1a91484d3a6700f2de6 (patch) | |
tree | cafb6a76808963c708006d16fc7a30f60d4f6eaf | |
parent | 20b44a3f56e857939bb29557afd0e1072ac30b5b (diff) | |
download | chrome-ec-b79fda068026092f4c2eb1a91484d3a6700f2de6.tar.gz |
SM5803: Disable end of charge detection
Since the fuel gague also provides end of charge detection, it's
unnecessary for the charger chip to also perform this. Additionally,
with the end of charge detection removed the board can now set auto
charge bits regardless of whether the battery is connected without
browning out.
BRANCH=None
BUG=b:163163442
TEST=on drawlat, verify booting without a battery does not brown out.
Verify that after SW battery cutoff the battery is able to come back
from disconnect reasonably quickly (within about 4 seconds post-boot)
Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: I57e77f5ea1860642ca565cd417ad9f14f7084b39
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2352436
-rw-r--r-- | driver/charger/sm5803.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/driver/charger/sm5803.c b/driver/charger/sm5803.c index df80cfe39d..dca3add717 100644 --- a/driver/charger/sm5803.c +++ b/driver/charger/sm5803.c @@ -354,6 +354,8 @@ static void sm5803_init(int chgnum) rv |= chg_write8(chgnum, 0x22, 0xB3); + rv |= chg_write8(chgnum, 0x3E, 0x34); + rv |= chg_write8(chgnum, 0x4B, 0xA6); rv |= chg_write8(chgnum, 0x4F, 0xBF); @@ -391,6 +393,8 @@ static void sm5803_init(int chgnum) rv |= chg_write8(chgnum, 0x22, 0xB3); + rv |= chg_write8(chgnum, 0x3E, 0x34); + rv |= chg_write8(chgnum, 0x4F, 0xBF); rv |= chg_write8(chgnum, 0x52, 0x77); @@ -649,8 +653,7 @@ static enum ec_error_list sm5803_set_mode(int chgnum, int mode) * Should be a part of an initial sink enable function */ rv |= sm5803_flow1_update(chgnum, CHARGER_MODE_SINK, MASK_SET); - if (battery_get_disconnect_state() == BATTERY_NOT_DISCONNECTED) - flow2_reg |= SM5803_FLOW2_AUTO_ENABLED; + flow2_reg |= SM5803_FLOW2_AUTO_ENABLED; } rv |= chg_write8(chgnum, SM5803_REG_FLOW2, flow2_reg); |