summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVijay Hiremath <vijay.p.hiremath@intel.com>2016-12-02 14:14:53 -0800
committerchrome-bot <chrome-bot@chromium.org>2016-12-07 00:36:41 -0800
commit81e20f0e589ecada5b30be3f64a09cc805b0a04a (patch)
treeb490589de475696c8da7268a010f2efbb39be6e3
parent515249a7d38c8c837e4fc5c414a67beb28516ba2 (diff)
downloadchrome-ec-81e20f0e589ecada5b30be3f64a09cc805b0a04a.tar.gz
charge_ramp: Reduce max ICL if VBUS drops on stable ramp
Some chargers lose VBUS even when ramp is stable and we re-ramp for those chargers. It continues in loop. To avoid this issue, reduce the max input current limit if VBUS drops on stable ramp. BUG=chrome-os-partner:60544 BRANCH=none TEST=Tested on Reef. Ramp settles to lower current and multiple re-ramp is not observed. Change-Id: I6c9ce4720d01b9e8e3215e8122f798076e516c19 Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/416349 Commit-Ready: Vijay P Hiremath <vijay.p.hiremath@intel.com> Tested-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Tested-by: Rachel Nancollas <rachelsn@google.com> Reviewed-by: Shawn N <shawnn@chromium.org>
-rw-r--r--common/charge_ramp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/common/charge_ramp.c b/common/charge_ramp.c
index f7bd48662e..175592e030 100644
--- a/common/charge_ramp.c
+++ b/common/charge_ramp.c
@@ -305,6 +305,8 @@ void chg_ramp_task(void)
if (board_is_ramp_allowed(active_sup) &&
board_is_vbus_too_low(CHG_RAMP_VBUS_STABLE)) {
CPRINTS("VBUS low; Re-ramp");
+ max_icl = MAX(min_icl,
+ max_icl - RAMP_ICL_BACKOFF);
active_icl_new = min_icl;
ramp_st_new = CHG_RAMP_RAMP;
}