diff options
author | Randall Spangler <rspangler@chromium.org> | 2012-10-24 18:42:18 -0700 |
---|---|---|
committer | Randall Spangler <rspangler@chromium.org> | 2012-10-24 18:48:55 -0700 |
commit | 61ebbbbbd7edb4f68fdb62f33076299d6b2fa3f8 (patch) | |
tree | 4455b7c8b98326373d0431001b50c4a5af706256 | |
parent | dc53e4db7fb2586ca3429ffb30d223de769e0c57 (diff) | |
download | chrome-ec-61ebbbbbd7edb4f68fdb62f33076299d6b2fa3f8.tar.gz |
link: Don't force battery to request current
Previously, the battery charging algorithm would give the battery
current even when it was requesting 0 mA.
BUG=chrome-os-partner:15573
BRANCH=link
TEST=charge battery and leave AC plugged in
Battery will eventually drop to 99% charged. At that point, it should
request 0mA, not 84mA or 85mA. (When it drops farther, it will really
start requesting charge.)
Change-Id: I464a7c8e857c928dbb9f9595f9c947d565b5f5c6
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/36526
Reviewed-by: Rong Chang <rongchang@chromium.org>
-rw-r--r-- | common/battery_link.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/common/battery_link.c b/common/battery_link.c index ba394eb51f..b20ab45fc1 100644 --- a/common/battery_link.c +++ b/common/battery_link.c @@ -123,12 +123,8 @@ void battery_vendor_params(struct batt_params *batt) limit_value(desired_current, current_limit[temp_range][volt_range]); #ifndef CONFIG_SLOW_PRECHARGE - /* Always request some current for trickle charging and pre-charging */ - /* - * TODO: (crosbug.com/p/15573) Shouldn't we only do this if desired - * current is non-zero? - */ - if (*desired_current < info.precharge_current) + /* If battery wants current, give it at least the precharge current */ + if (*desired_current > 0 && *desired_current < info.precharge_current) *desired_current = info.precharge_current; #endif /* CONFIG_SLOW_PRECHARGE */ |