diff options
author | Shawn Nematbakhsh <shawnn@chromium.org> | 2014-07-18 17:09:37 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-07-23 02:29:59 +0000 |
commit | b9677a48c81cc3b5074c532902076ff4ac64fe03 (patch) | |
tree | f3b3b0adb850d70d320ab142e88129cf09a369c0 /include/battery.h | |
parent | 4eee9fe42688e77c6c845a3904adb531a75f569a (diff) | |
download | chrome-ec-b9677a48c81cc3b5074c532902076ff4ac64fe03.tar.gz |
samus: Kick battery out of disconnect state when AC is attached
The Samus battery can be placed into a disconnect state by asserting a
disconnect input signal. In this state, the battery will not function
until a charging current is applied. This patch adds detection of the
disconnect state. If a battery in disconnect state is found, a current
is force-applied to the battery to kick it out of disconnect.
BRANCH=None
TEST=Manual on Samus.
1. Put battery into disconnect state
2. Pull AC, then reattach AC
3. Verify "found battery in disconnect state" is seen on the
EC console.
4. Pull AC and verify that EC console is still accessable
Also verify that battery gets out of reset state:
1. Pull AC
2. Issue "i2cxfer w16 0 0x16 0x0 0x12" command on EC console
3. Re-attach AC
4. Pull AC and verify that EC console is still accessable
BUG=chrome-os-partner:29465
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: Ib4268887fb483094ac4e641749200268160d3014
Reviewed-on: https://chromium-review.googlesource.com/209013
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Commit-Queue: Alec Berg <alecaberg@chromium.org>
Tested-by: Alec Berg <alecaberg@chromium.org>
Diffstat (limited to 'include/battery.h')
-rw-r--r-- | include/battery.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/battery.h b/include/battery.h index 898e3da403..18c84a37d3 100644 --- a/include/battery.h +++ b/include/battery.h @@ -49,6 +49,12 @@ enum battery_cutoff_states { BATTERY_CUTOFF_STATE_PENDING, }; +enum battery_disconnect_state { + BATTERY_DISCONNECTED = 0, + BATTERY_NOT_DISCONNECTED, + BATTERY_DISCONNECT_ERROR, +}; + /* Battery parameters */ struct batt_params { int temperature; /* Temperature in 0.1 K */ @@ -320,4 +326,9 @@ int battery_wait_for_stable(void); */ void print_battery_debug(void); +/** + * Get the disconnect state of the battery. + */ +enum battery_disconnect_state battery_get_disconnect_state(void); + #endif /* __CROS_EC_BATTERY_H */ |