summaryrefslogtreecommitdiff
path: root/include/battery.h
diff options
context:
space:
mode:
authorMary Ruthven <mruthven@chromium.org>2015-10-21 10:51:21 -0700
committerchrome-bot <chrome-bot@chromium.org>2015-10-27 11:52:34 -0700
commitcb4a76e8022c73fb0a0b50700912d86f41ea3dbb (patch)
tree0cfcc8ead036350e3ad994ee8229dac69a7f5b28 /include/battery.h
parent95e8bc2e0bed68b040d2b19d1dd62a4debcc1852 (diff)
downloadchrome-ec-cb4a76e8022c73fb0a0b50700912d86f41ea3dbb.tar.gz
i2c: get battery information from charge state
ARM systems currently use SBS kernel driver which talks to the battery through I2C passthu in the EC. Instead when asking for battery information try getting it from the charge state machine first, and then try the battery if charge state does not have the information. This reduces latency by cutting out the battery response time. BUG=chromium:484841 BRANCH=none TEST=check that power_supply_info works properly on Jerry Change-Id: If4da15ccabe412adc31fc94b189089ebb3e9265c Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/307905 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Alec Berg <alecaberg@chromium.org>
Diffstat (limited to 'include/battery.h')
-rw-r--r--include/battery.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/battery.h b/include/battery.h
index 18c84a37d3..e79ddd3adf 100644
--- a/include/battery.h
+++ b/include/battery.h
@@ -65,6 +65,7 @@ struct batt_params {
int desired_current; /* Charging current desired by battery (mA) */
int remaining_capacity; /* Remaining capacity in mAh */
int full_capacity; /* Capacity in mAh (might change occasionally) */
+ int status; /* Battery status */
enum battery_present is_present; /* Is the battery physically present */
int flags; /* Flags */
};
@@ -86,8 +87,9 @@ struct batt_params {
#define BATT_FLAG_BAD_DESIRED_CURRENT 0x00000080
#define BATT_FLAG_BAD_REMAINING_CAPACITY 0x00000100
#define BATT_FLAG_BAD_FULL_CAPACITY 0x00000200
+#define BATT_FLAG_BAD_STATUS 0x00000400
/* All of the above BATT_FLAG_BAD_* bits */
-#define BATT_FLAG_BAD_ANY 0x000003fc
+#define BATT_FLAG_BAD_ANY 0x000007fc
/* Battery constants */
struct battery_info {