diff options
author | Vic Yang <victoryang@chromium.org> | 2013-09-04 20:59:44 +0800 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2013-09-05 07:20:18 +0000 |
commit | 30136468c0352a2bcce1a948d9d5e9e4851b294d (patch) | |
tree | 0c2099448dbaa47949d82ab7d7bacb8d5d427956 /include/battery.h | |
parent | 0492ff9204a527b7cc9bbe84766d9507f52260a6 (diff) | |
download | chrome-ec-30136468c0352a2bcce1a948d9d5e9e4851b294d.tar.gz |
Extend charge state machine to accommodate Kirby
Currently only x86 platform uses charge_state.c, and it's been tailored
to fit smart battery and bq247xx charger family.
For Kirby, we have different types of battery and charger, and thus need
to make some change to accommodate them. This includes:
- Abstract out smart battery specific bit mask
- Implement missing functions required by GAIA chipset module
- Add config flags for charging-enabled GPIO pin
- Allow battery that doesn't report desired voltage and current
BUG=chrome-os-partner:22055
TEST=Build all boards
TEST=Boot Link and check it charges/discharges battery
TEST=Test charging/discharging on Kirby along with the next two CLs
BRANCH=None
Change-Id: I910c030a45b4f775afffec0127cdc31e89b9dd55
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/168005
Diffstat (limited to 'include/battery.h')
-rw-r--r-- | include/battery.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/include/battery.h b/include/battery.h index 39a7aea0d1..c5177d6cae 100644 --- a/include/battery.h +++ b/include/battery.h @@ -54,9 +54,13 @@ int battery_state_of_charge(int *percent); int battery_state_of_charge_abs(int *percent); /* - * Return non-zero if the battery is reporting capacity in 10mW. - * Otherwise, in mAh. */ -int battery_is_in_10mw_mode(void); + * Set 'val' to non-zero if the battery is reporting capacity in 10mW. + * Otherwise, in mAh. + */ +int battery_is_in_10mw_mode(int *val); + +/* Set battery capacity mode to mAh(=0) or 10mW(=1). */ +int battery_set_10mw_mode(int enabled); /* * Battery remaining capacity @@ -85,6 +89,9 @@ int battery_desired_current(int *current); */ int battery_desired_voltage(int *voltage); +/* Check if battery allows charging */ +int battery_charging_allowed(int *allowed); + /* Read battery status */ int battery_status(int *status); |