summaryrefslogtreecommitdiff
path: root/common/charge_ramp.c
diff options
context:
space:
mode:
authorShawn Nematbakhsh <shawnn@chromium.org>2016-09-09 10:11:18 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-09-13 22:21:23 -0700
commit94f2bc074087b72bbddf2fcbffa0f53e7aeb3aa0 (patch)
treebbb048a2e50592415d5f9acc21b54164afefdc82 /common/charge_ramp.c
parentd8166a8d65bc776ad2484ac49cd4d7a218b48d7c (diff)
downloadchrome-ec-94f2bc074087b72bbddf2fcbffa0f53e7aeb3aa0.tar.gz
charge_manager: Pass uncapped / max current to current limit callback
charge_manager may request a charge current limit less than the capability of the supply in certain cases (eg. during PD voltage transition, to make an effort to comply with reduced load spec). Depending on the battery / system state, setting a reduced charge current limit may result in brownout. Pass the uncapped / max negotiated current to board_set_charge_limit() so that boards may use it instead of the requested limit in such circumstances. BUG=chrome-os-partner:56139 BRANCH=gru TEST=Manual on kevin with subsequent commit, boot system with zinger + low-charge battery, verify devices powers up to OS without brownout. Change-Id: I2b8e0d44edcf57ffe4ee0fdec1a1ed35c6becbbd Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/383732 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'common/charge_ramp.c')
-rw-r--r--common/charge_ramp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/common/charge_ramp.c b/common/charge_ramp.c
index 4a1399b54e..e63b37b9bd 100644
--- a/common/charge_ramp.c
+++ b/common/charge_ramp.c
@@ -146,7 +146,7 @@ int chg_ramp_is_stable(void)
void chg_ramp_task(void)
{
int task_wait_time = -1;
- int i;
+ int i, lim;
uint64_t detect_end_time_us = 0, time_us;
int last_active_port = CHARGE_PORT_NONE;
@@ -319,8 +319,8 @@ void chg_ramp_task(void)
active_icl = active_icl_new;
/* Set the input current limit */
- board_set_charge_limit(active_port, active_sup,
- chg_ramp_get_current_limit());
+ lim = chg_ramp_get_current_limit();
+ board_set_charge_limit(active_port, active_sup, lim, lim);
if (ramp_st == CHG_RAMP_STABILIZE)
/*