summaryrefslogtreecommitdiff
path: root/include/charge_state.h
diff options
context:
space:
mode:
authorShawn Nematbakhsh <shawnn@chromium.org>2014-12-16 09:54:54 -0800
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-12-17 18:07:10 +0000
commita7bae3588cb976405b90677a324de06c71fa3f48 (patch)
treef758c61f021485acee7ee82e4ebfa51f3b0300a9 /include/charge_state.h
parent6c980a4dbf2e37b83e868c0eb12774190ea8c94d (diff)
downloadchrome-ec-a7bae3588cb976405b90677a324de06c71fa3f48.tar.gz
power_button_x86: Inhibit AP power-on if battery level is too low
Allow CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON to be defined at the board level to be the minimum battery percentage required for power-on. If the battery level is below the threshold, or if the battery is missing, power button presses will be ignored. BUG=chrome-os-partner:31127 TEST=Manual on Samus with subsequent commit. Verify that AP continues to boot normally when charge level exceeds CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON. Verify that power button presses are ignored when the charge level is below the threshold, and we return to G3. BRANCH=Samus Change-Id: I0ff3f7ddabf38080332470e172c8b2e307bf1655 Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/236021 Reviewed-by: Alec Berg <alecaberg@chromium.org>
Diffstat (limited to 'include/charge_state.h')
-rw-r--r--include/charge_state.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/charge_state.h b/include/charge_state.h
index 5c81decf10..fea4231def 100644
--- a/include/charge_state.h
+++ b/include/charge_state.h
@@ -98,6 +98,12 @@ int charge_get_percent(void);
int charge_want_shutdown(void);
/**
+ * Return non-zero if the battery level is too low to allow power on, even if
+ * a charger is attached.
+ */
+int charge_prevent_power_on(void);
+
+/**
* Get the last polled battery/charger temperature.
*
* @param idx Sensor index to read.