summaryrefslogtreecommitdiff
path: root/include/charge_state.h
diff options
context:
space:
mode:
authorLouis Yung-Chieh Lo <yjlou@chromium.org>2014-01-03 15:53:55 -0800
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-01-07 04:53:20 +0000
commit5a4b239981a76aa9e98325bc082c67cbdfe487de (patch)
treeeda7b0278dff3eaf03a3cba4e4d7ac576edd1a67 /include/charge_state.h
parent4e27a42ff9d2b7bb566b6bc455404657a3250c91 (diff)
downloadchrome-ec-5a4b239981a76aa9e98325bc082c67cbdfe487de.tar.gz
rename power_state* to charge_state*
Those are actually charge state, not power state. Rename the misleading names. BUG=chrome-os-partner:24832 BRANCH=link,falco,samus,rambi,peppy,spring,pit,snow TEST=build only because no name conflicts. make clean BOARD=link && make -j32 BOARD=link && \ make clean BOARD=falco && make -j 32 BOARD=falco && \ make clean BOARD=samus && make -j 32 BOARD=samus && \ make clean BOARD=rambi && make -j 32 BOARD=rambi && \ make clean BOARD=peppy && make -j 32 BOARD=peppy && \ make clean BOARD=snow && make -j 32 BOARD=snow && \ make clean BOARD=spring && make -j 32 BOARD=spring && \ make clean BOARD=pit && make -j 32 BOARD=pit && \ make clean BOARD=nyan && make -j 32 BOARD=nyan && \ make runtests -j 32 && make tests -j 32 BOARD=link && \ make tests -j 32 BOARD=falco && make tests -j 32 BOARD=samus && \ make tests -j 32 BOARD=rambi && make tests -j 32 BOARD=peppy && \ make tests -j 32 BOARD=snow && make tests -j 32 BOARD=spring && \ make tests -j 32 BOARD=pit && make tests -j 32 BOARD=nyan Change-Id: Ie15052d5a7dbd97d519303d37260945346a27779 Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/181505 Reviewed-by: Vic Yang <victoryang@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'include/charge_state.h')
-rw-r--r--include/charge_state.h23
1 files changed, 11 insertions, 12 deletions
diff --git a/include/charge_state.h b/include/charge_state.h
index 5a176c1b40..7aaf77b93d 100644
--- a/include/charge_state.h
+++ b/include/charge_state.h
@@ -41,7 +41,7 @@
F_CHARGER_INIT)
/* Power states */
-enum power_state {
+enum charge_state {
/* Meta-state; unchanged from previous time through task loop */
PWR_STATE_UNCHANGE = 0,
/* Initializing charge state machine at boot */
@@ -68,11 +68,10 @@ enum power_state {
/* External (AC) power is present */
#define CHARGE_FLAG_EXTERNAL_POWER (1 << 1)
-/* Debugging constants, in the same order as enum power_state. This string
+/* Debugging constants, in the same order as enum charge_state. This string
* table was moved here to sync with enum above.
*/
-#define POWER_STATE_NAME_TABLE \
- { \
+#define CHARGE_STATE_NAME_TABLE { \
"unchange", \
"init", \
"reinit", \
@@ -83,17 +82,17 @@ enum power_state {
"charge_near_full", \
"error" \
}
- /* End of POWER_STATE_NAME_TABLE macro */
+ /* End of CHARGE_STATE_NAME_TABLE macro */
/* Power state data
* Status collection of charging state machine.
*/
-struct power_state_data {
+struct charge_state_data {
int ac;
int charging_voltage;
int charging_current;
struct batt_params batt;
- enum power_state state;
+ enum charge_state state;
uint32_t error;
timestamp_t ts;
};
@@ -102,10 +101,10 @@ struct power_state_data {
* The shared context for state handler. The context contains current and
* previous state.
*/
-struct power_state_context {
- struct power_state_data curr;
- struct power_state_data prev;
- timestamp_t power_state_updated_time;
+struct charge_state_context {
+ struct charge_state_data curr;
+ struct charge_state_data prev;
+ timestamp_t charge_state_updated_time;
uint32_t *memmap_batt_volt;
uint32_t *memmap_batt_rate;
uint32_t *memmap_batt_cap;
@@ -124,7 +123,7 @@ struct power_state_context {
/**
* Return current charge state.
*/
-enum power_state charge_get_state(void);
+enum charge_state charge_get_state(void);
/**
* Return current charge state flags (CHARGE_FLAG_*)