summaryrefslogtreecommitdiff
path: root/include/charge_state.h
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@chromium.org>2014-04-09 14:02:55 -0700
committerBill Richardson <wfrichar@chromium.org>2014-04-11 15:37:38 +0000
commit5019551e1d63bdd95e8b358a409e923c16e604fd (patch)
treeadfaecb5b6c4e3f0ebb39019e8c818f02e506705 /include/charge_state.h
parent39194d5fc584199fad690939b362e61b1aa4a12d (diff)
downloadchrome-ec-5019551e1d63bdd95e8b358a409e923c16e604fd.tar.gz
Move common charge_state time constants to a common header
We had duplicate values in both v1 and v2 headers. Let's consolidate them in one place, and prefix the constants with "CHARGE_", so people don't use them randomly. BUG=chrome-os-partner:20881 BRANCH=ToT TEST=make buildall -j No functionality changes, refactor/rename only. Change-Id: I0ee599a2e3bf0835c2c0a7e57872ad9015701a4b Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/193876
Diffstat (limited to 'include/charge_state.h')
-rw-r--r--include/charge_state.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/charge_state.h b/include/charge_state.h
index 581acfd285..35c2041d45 100644
--- a/include/charge_state.h
+++ b/include/charge_state.h
@@ -6,8 +6,23 @@
#define __CROS_EC_CHARGE_STATE_H
#include "common.h"
+#include "timer.h"
/* Stuff that's common to all charger implementations can go here. */
+
+/* Seconds after AP battery shutdown warning before we kill the AP */
+#define LOW_BATTERY_SHUTDOWN_TIMEOUT 30
+/* Seconds to spend trying to wake a non-responsive battery */
+#define PRECHARGE_TIMEOUT 30
+
+/* Power state task polling periods in usec */
+#define CHARGE_POLL_PERIOD_VERY_LONG MINUTE
+#define CHARGE_POLL_PERIOD_LONG (MSEC * 500)
+#define CHARGE_POLL_PERIOD_CHARGE (MSEC * 250)
+#define CHARGE_POLL_PERIOD_SHORT (MSEC * 100)
+#define CHARGE_MIN_SLEEP_USEC (MSEC * 50)
+#define CHARGE_MAX_SLEEP_USEC SECOND
+
/* Power states */
enum charge_state {
/* Meta-state; unchanged from previous time through task loop */