From 81e20f0e589ecada5b30be3f64a09cc805b0a04a Mon Sep 17 00:00:00 2001 From: Vijay Hiremath Date: Fri, 2 Dec 2016 14:14:53 -0800 Subject: 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 Reviewed-on: https://chromium-review.googlesource.com/416349 Commit-Ready: Vijay P Hiremath Tested-by: Vijay P Hiremath Tested-by: Rachel Nancollas Reviewed-by: Shawn N --- common/charge_ramp.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'common') 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; } -- cgit v1.2.1