summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2012-10-24 18:42:18 -0700
committerRandall Spangler <rspangler@chromium.org>2012-10-24 18:53:02 -0700
commit7a3c950696afb259e94c4e35a73b5d5c662078cd (patch)
tree124200eb20d6a496b03a740b0dde11dcaff946e8
parent3e586fa20b1c320138a517c8121cfaf45d8aa7ad (diff)
downloadchrome-ec-7a3c950696afb259e94c4e35a73b5d5c662078cd.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.) Original-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> (cherry picked from commit 61ebbbbbd7edb4f68fdb62f33076299d6b2fa3f8) Conflicts: common/battery_link.c Change-Id: I3877ca0aaa36d4ce0407f25a0e19fc164f3c4d15 Reviewed-on: https://gerrit.chromium.org/gerrit/36527 Reviewed-by: Randall Spangler <rspangler@chromium.org> Tested-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r--common/battery_link.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/common/battery_link.c b/common/battery_link.c
index 2a524dea38..0ad3bb5e65 100644
--- a/common/battery_link.c
+++ b/common/battery_link.c
@@ -137,8 +137,8 @@ void battery_vendor_params(struct batt_params *batt)
limit_value(desired_current, current_limit[temp_range][volt_range]);
#ifndef CONFIG_SLOW_PRECHARGE
- /* Trickle charging and pre-charging current should be 0.01 C */
- 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 */