summaryrefslogtreecommitdiff
path: root/include/charge_manager.h
diff options
context:
space:
mode:
authorAlec Berg <alecaberg@chromium.org>2014-12-17 13:22:36 -0800
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-01-03 02:26:21 +0000
commit2b0895179733852a7eb13051ad99a494af5cc3bd (patch)
tree557338d88ec7a20212bc8c4f457d7867073513a5 /include/charge_manager.h
parenta3f3e38da09eb196a5773021a54832a553c206e3 (diff)
downloadchrome-ec-2b0895179733852a7eb13051ad99a494af5cc3bd.tar.gz
samus: when battery is full, and not in S0, stop charging
When battery is full and system is not in S0, then stop charging and allow battery to power the system. Once battery is no longer full and requests current, allow charging again. This is to work around power consumption issues in our AC input path. The charge override port is stored upon entering S3 and restored going back to S0 so that the charge override port is not affected by this. This also fixes lightbar so lightbar checks if battery is full instead of checking raw percentage. The lightbar is also changed to use the last tap direction if no charger is plugged in. And the lightbar tap for battery threshold for turning green is lowered to 95%. This also moves some samus_pd board code out of interrupt handlers and in to deferred functions to minimize time in interrupts. BUG=chrome-os-partner:34640, chrome-os-partner:34847 BRANCH=samus TEST=load onto samus. use battfake command from pd console to set battery percentage. when system is in G3, see that batt = 100% stops charging, and when batt < 100% it starts charging again. tested that we receive host command from EC with battery information every time battery changes SOC. Change-Id: Ia8e0721508e34ee3630f5e5b0c2f431a00329caf Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/236411 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'include/charge_manager.h')
-rw-r--r--include/charge_manager.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/charge_manager.h b/include/charge_manager.h
index d1ee472a50..0b1de3186d 100644
--- a/include/charge_manager.h
+++ b/include/charge_manager.h
@@ -31,6 +31,7 @@ void charge_manager_set_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);
/* Returns the current active charge port, as determined by charge manager */
int charge_manager_get_active_charge_port(void);