diff options
author | Caveh Jalali <caveh@chromium.org> | 2021-11-08 19:32:14 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-11-11 20:58:39 +0000 |
commit | 65ec8708608955683f04e7bbfdf2cef39b5214f9 (patch) | |
tree | 7e04991794c95443b1ad1e55ed1c165bfded659c /driver | |
parent | f764caac04ce12f7bcd404f17db27631c51c84b8 (diff) | |
download | chrome-ec-65ec8708608955683f04e7bbfdf2cef39b5214f9.tar.gz |
bq25710: Allow BATOC threshold to be configured
This adds support for selecting the minimum BATOC protection threshold
to be used with EN_BATOC. The minimum threshold is 150% of PROCHOT IDCHG
on the bq25710 and 133% of PROCHOT IDCHG_TH2 on the bq25720. The default
threshold is 200% on both chips.
BRANCH=none
BUG=b:185190976
TEST=buildall passes
Signed-off-by: Caveh Jalali <caveh@chromium.org>
Change-Id: I22576d1cf7c78bfefeb1c2582434ddc0220a1928
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3275001
Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'driver')
-rw-r--r-- | driver/charger/bq25710.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/driver/charger/bq25710.c b/driver/charger/bq25710.c index 97a8299802..e7b3abca5d 100644 --- a/driver/charger/bq25710.c +++ b/driver/charger/bq25710.c @@ -298,6 +298,16 @@ static int bq257x0_init_charge_option_2(int chgnum) reg = SET_CO2_BY_NAME(ACOC_VTH, 1P33, reg); } + if (IS_ENABLED(CONFIG_CHARGER_BQ25710_BATOC_VTH_MINIMUM)) { + /* Set battery over-current threshold to minimum. */ + if (IS_ENABLED(CONFIG_CHARGER_BQ25720)) + reg = SET_BQ_FIELD_BY_NAME(BQ25720, CHARGE_OPTION_2, + BATOC_VTH, 1P33, reg); + else + reg = SET_BQ_FIELD_BY_NAME(BQ25710, CHARGE_OPTION_2, + BATOC_VTH, 1P50, reg); + } + return raw_write16(chgnum, BQ25710_REG_CHARGE_OPTION_2, reg); } |