summaryrefslogtreecommitdiff
path: root/include/charger.h
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2012-09-21 14:48:47 -0700
committerGerrit <chrome-bot@google.com>2012-09-24 10:56:50 -0700
commit8b592052cea122105996f13a8cb2e44ea22449fc (patch)
tree10f1bcdb051a403141f1c072f37ce72e8049d8b4 /include/charger.h
parent3c4f66648d74fea0937478042c26c4e729d47e58 (diff)
downloadchrome-ec-8b592052cea122105996f13a8cb2e44ea22449fc.tar.gz
Only ask the charger for current steps it can supply
This reduces oscillations in the charging algorithm. This change also adds more debug output so it's easier to see what the charging state machine is doing. BUG=chrome-os-partner:9572 BRANCH=link TEST=discharge battery; charge battery; note infrequent but useful debug output Change-Id: I4c8609c2ca8a6cab3eae151ecf2bb1520103fece Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/33811 Reviewed-by: Rong Chang <rongchang@chromium.org>
Diffstat (limited to 'include/charger.h')
-rw-r--r--include/charger.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/charger.h b/include/charger.h
index 899dbd4883..572ae51aea 100644
--- a/include/charger.h
+++ b/include/charger.h
@@ -44,6 +44,15 @@ int charger_get_status(int *status);
*/
int charger_set_mode(int mode);
+/**
+ * Return the closest match the charger can supply to the requested current.
+ *
+ * @param current Requested current in mA.
+ *
+ * @return Current the charger will actually supply if <current> is requested.
+ */
+int charger_closest_current(int current);
+
/* Get/set charge current limit in mA */
int charger_get_current(int *current);
int charger_set_current(int current);