summaryrefslogtreecommitdiff
path: root/include/battery.h
diff options
context:
space:
mode:
authorNicolas Boichat <drinkcat@chromium.org>2018-01-26 12:24:13 +0800
committerchrome-bot <chrome-bot@chromium.org>2018-02-07 11:55:57 -0800
commitad286a050ea566ebd89cb53f5118c91b04a0980c (patch)
treee971a973353b0b2477429009d7f3804bd8d9ecec /include/battery.h
parentc8e2deb24dbbf4165acac4d3b72376d98ec210a1 (diff)
downloadchrome-ec-ad286a050ea566ebd89cb53f5118c91b04a0980c.tar.gz
charge_state_v2: Store battery information in new structures
On dual battery systems, this allows to keep both batteries information in similar structures. This also means that battery information can only be fetched via host commands EC_CMD_BATTERY_GET_STATIC/DYNAMIC (next CL will make it possible to fetch the information via shared memory/ACPI). BRANCH=none BUG=b:65697620 TEST=Boot lux/wand, dual-battery algorithm works, AP can fetch both battery information via host commands. Change-Id: I3c087e8f378c5cef0006f6bfe58335228a880e5b Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/888381 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org>
Diffstat (limited to 'include/battery.h')
-rw-r--r--include/battery.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/battery.h b/include/battery.h
index 43425fcd8c..b783432ded 100644
--- a/include/battery.h
+++ b/include/battery.h
@@ -9,6 +9,20 @@
#define __CROS_EC_BATTERY_H
#include "common.h"
+#include "host_command.h"
+
+/* Battery index, only used with CONFIG_BATTERY_V2. */
+enum battery_index {
+ BATT_IDX_MAIN,
+ BATT_IDX_BASE,
+};
+
+#ifdef CONFIG_BATTERY_V2
+extern struct ec_response_battery_static_info
+ battery_static[CONFIG_BATTERY_COUNT];
+extern struct ec_response_battery_dynamic_info
+ battery_dynamic[CONFIG_BATTERY_COUNT];
+#endif
/* Stop charge when charging and battery level >= this percentage */
#define BATTERY_LEVEL_FULL 100