summaryrefslogtreecommitdiff
path: root/include/charge_manager.h
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 /include/charge_manager.h
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 'include/charge_manager.h')
-rw-r--r--include/charge_manager.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/charge_manager.h b/include/charge_manager.h
index 939471163b..71cc8589aa 100644
--- a/include/charge_manager.h
+++ b/include/charge_manager.h
@@ -73,6 +73,16 @@ enum ceil_requestor {
/* Update charge ceiling for a given port / requestor */
void charge_manager_set_ceil(int port, enum ceil_requestor requestor, int ceil);
+/*
+ * Update PD charge ceiling for a given port. In the event that our ceiling
+ * is currently above ceil, change the current limit before returning, without
+ * waiting for a charge manager refresh. This function should only be used in
+ * time-critical situations where we absolutely cannot proceed without limiting
+ * our input current, and it should only be called from the PD tasks.
+ * If you ever call this function then you are a terrible person.
+ */
+void charge_manager_force_ceil(int port, int ceil);
+
/* Select an 'override port', which is always the preferred charge port */
int charge_manager_set_override(int port);
int charge_manager_get_override(void);