summaryrefslogtreecommitdiff
path: root/include/charge_state.h
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2013-03-14 12:39:00 -0700
committerChromeBot <chrome-bot@google.com>2013-03-14 15:44:14 -0700
commit75acd4065ab720cdb72c165aa2d3b3e48852267a (patch)
tree75d5a6da1d374cab94f2786e91891c377ffdbd66 /include/charge_state.h
parent10d845eb10e4a7030815c687b13bbd09e905edb8 (diff)
downloadchrome-ec-75acd4065ab720cdb72c165aa2d3b3e48852267a.tar.gz
Clean up power LED state machine on link
The power LED now has its own tick-based handler which knows how to blink the LED and resend the desired LED state to work around the flaky 1-wire connection. Removes a bunch of LED state code from charge_state.c. No user-visible impact. Does not need to go into link branch. BUG=chromium-os:18256 BRANCH=none TEST=manual 1) Discharge battery to <97% 2) Plug in AC. LED=yellow 3) 'ectool chargeforceidle 1' from root shell. LED=blinking green/off. 4) 'ectool chargeforceidle 0' from root shell. LED=yellow. 5) Wait for battery >= 97% (or 'battfake 98' from EC console). LED=green. 6) Unplug battery. LED=red (may take 10 sec). 7) Replug battery. LED=green. Change-Id: I999ee3e1abe269bb3f737bbc75e0b872316605ce Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/45469 Reviewed-by: Vic Yang <victoryang@chromium.org>
Diffstat (limited to 'include/charge_state.h')
-rw-r--r--include/charge_state.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/charge_state.h b/include/charge_state.h
index fcb68be89d..bf6404593e 100644
--- a/include/charge_state.h
+++ b/include/charge_state.h
@@ -62,6 +62,10 @@ enum power_state {
PWR_STATE_ERROR
};
+/* Charge state flags */
+/* Forcing idle state */
+#define CHARGE_FLAG_FORCE_IDLE (1 << 0)
+
/* Debugging constants, in the same order as enum power_state. This string
* table was moved here to sync with enum above.
*/
@@ -128,6 +132,11 @@ enum power_state trickle_charge(struct power_state_context *ctx);
enum power_state charge_get_state(void);
/**
+ * Return current charge state flags (CHARGE_FLAG_*)
+ */
+uint32_t charge_get_flags(void);
+
+/**
* Return current battery charge percentage.
*/
int charge_get_percent(void);