summaryrefslogtreecommitdiff
path: root/test/charge_manager.c
diff options
context:
space:
mode:
authorShawn Nematbakhsh <shawnn@chromium.org>2016-10-17 14:12:38 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-12-05 16:42:58 -0800
commit64414f92b30d3d75d0ba29fd8b32f772a16acdff (patch)
treed48e47fd8ad8476139beba9af39204200ca175bd /test/charge_manager.c
parentd447b71f7132111beb8f973337ec6cabf15fe384 (diff)
downloadchrome-ec-64414f92b30d3d75d0ba29fd8b32f772a16acdff.tar.gz
pd: Limit input current to 500mA on PD voltage transition
Upon requesting a PD power contract at a new voltage, keep the input current limit at 500mA until PD_RDY is received. BUG=b:30744563,chrome-os-partner:59311,chrome-os-partner:44340 BRANCH=ryu, gru, glados TEST=Manual on kevin, set ilim to 5V through `chglim` console command, attach zinger. Set ilim to 20V through `chglim`, verify that ilim goes from 3A to 500mA to 3A. Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Change-Id: I452f183cfb958780e336a9f99dc6398356de17a0 Reviewed-on: https://chromium-review.googlesource.com/399918 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Todd Broch <tbroch@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'test/charge_manager.c')
-rw-r--r--test/charge_manager.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/charge_manager.c b/test/charge_manager.c
index bb65c2a3f0..1c08245b92 100644
--- a/test/charge_manager.c
+++ b/test/charge_manager.c
@@ -288,6 +288,14 @@ static int test_charge_ceil(void)
TEST_ASSERT(active_charge_port == 1);
TEST_ASSERT(active_charge_limit == 2500);
+ /* Verify forced ceil takes effect immediately */
+ charge_manager_force_ceil(1, 500);
+ TEST_ASSERT(active_charge_port == 1);
+ TEST_ASSERT(active_charge_limit == 500);
+ wait_for_charge_manager_refresh();
+ TEST_ASSERT(active_charge_port == 1);
+ TEST_ASSERT(active_charge_limit == 500);
+
return EC_SUCCESS;
}