diff options
author | Philip Chen <philipchen@google.com> | 2018-03-11 15:03:05 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-03-12 20:57:02 -0700 |
commit | b8423e066922f70d65248abd8ad325177bfc615f (patch) | |
tree | 540704a260c13210406900266d966b3689d72f27 | |
parent | c69a80d0bc2399563c4035965183e1536b9a65da (diff) | |
download | chrome-ec-b8423e066922f70d65248abd8ad325177bfc615f.tar.gz |
charger/rt946x: Enable charge current termination
BUG=b:74373538
BRANCH=scarlet
TEST=confirm charge current drops to 0mA right after
it hits 400mA, when battery is nearly fully charged
Change-Id: Icd4a7886bf68f3bd4ed91d2b8e705cb62f6e4fb8
Signed-off-by: Philip Chen <philipchen@google.com>
Reviewed-on: https://chromium-review.googlesource.com/958295
Commit-Ready: Philip Chen <philipchen@chromium.org>
Tested-by: Philip Chen <philipchen@chromium.org>
Reviewed-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-by: David Schneider <dnschneid@chromium.org>
-rw-r--r-- | driver/charger/rt946x.c | 6 | ||||
-rw-r--r-- | driver/charger/rt946x.h | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/driver/charger/rt946x.c b/driver/charger/rt946x.c index 5c1acfac79..378d8f6814 100644 --- a/driver/charger/rt946x.c +++ b/driver/charger/rt946x.c @@ -49,7 +49,7 @@ struct charger_init_setting { }; static const struct charger_init_setting rt946x_charger_init_setting = { - .eoc_current = 250, + .eoc_current = 400, .mivr = 4000, .ircmp_vclamp = 32, .ircmp_res = 25, @@ -399,6 +399,10 @@ static int rt946x_init_setting(void) rv = rt946x_set_iprec(batt_info->precharge_current); if (rv) return rv; + /* Enable charge current termination */ + rv = rt946x_set_bit(RT946X_REG_CHGCTRL2, RT946X_MASK_TE); + if (rv) + return rv; return rt946x_init_irq(); } diff --git a/driver/charger/rt946x.h b/driver/charger/rt946x.h index a31415b136..48f9cd02e9 100644 --- a/driver/charger/rt946x.h +++ b/driver/charger/rt946x.h @@ -140,10 +140,12 @@ /* ========== CHGCTRL2 0x02 ============ */ #define RT946X_SHIFT_SHIP_MODE 7 +#define RT946X_SHIFT_TE 4 #define RT946X_SHIFT_ILMTSEL 2 #define RT946X_SHIFT_CHG_EN 0 #define RT946X_MASK_SHIP_MODE (1 << RT946X_SHIFT_SHIP_MODE) +#define RT946X_MASK_TE (1 << RT946X_SHIFT_TE) #define RT946X_MASK_ILMTSEL 0x0C #define RT946X_MASK_CHG_EN (1 << RT946X_SHIFT_CHG_EN) |