summaryrefslogtreecommitdiff
path: root/common/charge_ramp.c
diff options
context:
space:
mode:
authorShawn Nematbakhsh <shawnn@chromium.org>2017-01-31 10:48:31 -0800
committerchrome-bot <chrome-bot@chromium.org>2017-02-02 19:09:52 -0800
commitf08109522dab20b9621489ccf04e98c26c30cd3f (patch)
treedb3a002c7833c46244b1550150e7a7d2b3e1b367 /common/charge_ramp.c
parent7e2f31f537c8e6bbf149d086543ead937fc9f329 (diff)
downloadchrome-ec-f08109522dab20b9621489ccf04e98c26c30cd3f.tar.gz
charge_ramp: Specify port number in board_is_vbus_too_low()
charge_ramp needs to make a decision based upon the VBUS level on one specific port - the port that is ramping. The VBUS level on any other charge ports (if present) is not relevant. BUG=chrome-os-partner:54099 BRANCH=reef, gru TEST=With subsequent patches, verify charge_ramp success with a variety of BC1.2 chargers. Change-Id: Ie0a51a577e2b7491222560cd08dd5321ff3b7975 Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/435561 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'common/charge_ramp.c')
-rw-r--r--common/charge_ramp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/common/charge_ramp.c b/common/charge_ramp.c
index f6942d7516..1c9dfecc33 100644
--- a/common/charge_ramp.c
+++ b/common/charge_ramp.c
@@ -264,7 +264,8 @@ void chg_ramp_task(void)
}
/* If VBUS is sagging a lot, then stop ramping */
- if (board_is_vbus_too_low(CHG_RAMP_VBUS_RAMPING)) {
+ if (board_is_vbus_too_low(active_port,
+ CHG_RAMP_VBUS_RAMPING)) {
CPRINTS("VBUS low");
active_icl_new = MAX(min_icl, active_icl -
RAMP_ICL_BACKOFF);
@@ -310,7 +311,8 @@ void chg_ramp_task(void)
/* Keep an eye on VBUS and restart ramping if it dips */
if (board_is_ramp_allowed(active_sup) &&
- board_is_vbus_too_low(CHG_RAMP_VBUS_STABLE)) {
+ board_is_vbus_too_low(active_port,
+ CHG_RAMP_VBUS_STABLE)) {
CPRINTS("VBUS low; Re-ramp");
max_icl = MAX(min_icl,
max_icl - RAMP_ICL_BACKOFF);