diff options
author | Randall Spangler <rspangler@chromium.org> | 2013-02-28 11:05:30 -0800 |
---|---|---|
committer | ChromeBot <chrome-bot@google.com> | 2013-02-28 16:12:05 -0800 |
commit | d86df6c38883435c9df5de3bd7ba1c2b35b67316 (patch) | |
tree | 4ac71ca05ff1963af5b7ffee6e0890af8aa70e0f /include | |
parent | 9a1fc51fafbf862c26a32750ef333cf485902cea (diff) | |
download | chrome-ec-d86df6c38883435c9df5de3bd7ba1c2b35b67316.tar.gz |
Add reinit state to charge_state module to distinguish it from at-ec-boot init
This is a precursor to changing the switch state machine to delay
powering on the AP until the charge_state module knows if there's
enough power to do so (which it will know when it leaves the INIT
state).
BUG=chrome-os-partner:17124
BRANCH=link
TEST=manual
1. Reboot EC on battery power. See charge state init->discharging
2. Plug in AC. See charge state discharging->reinit
(charge state will then transition to some other charging or idle state
based on battery level)
Change-Id: Ia02cc8b37e9b5e8d6dd8c2fbfdf14e385694b1bf
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/44291
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/charge_state.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/include/charge_state.h b/include/charge_state.h index 182a99f703..5f90de36fd 100644 --- a/include/charge_state.h +++ b/include/charge_state.h @@ -1,9 +1,9 @@ -/* Copyright (c) 2012 The Chromium OS Authors. All rights reserved. +/* Copyright (c) 2013 The Chromium OS Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. - * */ +#include "battery_pack.h" #include "timer.h" #ifndef __CROS_EC_CHARGE_STATE_H @@ -44,8 +44,10 @@ enum power_state { /* Meta-state; unchanged from previous time through task loop */ PWR_STATE_UNCHANGE = 0, - /* (Re-)initalizing charge state machine */ + /* Initializing charge state machine at boot */ PWR_STATE_INIT, + /* Re-initializing charge state machine */ + PWR_STATE_REINIT, /* Just transitioned from init to idle */ PWR_STATE_IDLE0, /* Idle; AC present */ @@ -67,6 +69,7 @@ enum power_state { { \ "unchange", \ "init", \ + "reinit", \ "idle0", \ "idle", \ "discharge", \ |