summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorShawn Nematbakhsh <shawnn@chromium.org>2014-07-18 17:09:37 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-07-23 02:29:59 +0000
commitb9677a48c81cc3b5074c532902076ff4ac64fe03 (patch)
treef3b3b0adb850d70d320ab142e88129cf09a369c0 /common
parent4eee9fe42688e77c6c845a3904adb531a75f569a (diff)
downloadchrome-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 'common')
-rw-r--r--common/charge_state_v2.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/common/charge_state_v2.c b/common/charge_state_v2.c
index c44d05e096..a3d6384027 100644
--- a/common/charge_state_v2.c
+++ b/common/charge_state_v2.c
@@ -598,6 +598,22 @@ void charger_task(void)
batt_info->precharge_current;
} else
#endif
+#ifdef CONFIG_BATTERY_REVIVE_DISCONNECT
+ if (curr.requested_voltage == 0 &&
+ curr.requested_current == 0 &&
+ battery_get_disconnect_state() ==
+ BATTERY_DISCONNECTED) {
+ /*
+ * Battery is in disconnect state. Apply a
+ * current to kick it out of this state.
+ */
+ CPRINTS("found battery in disconnect state");
+ curr.requested_voltage =
+ batt_info->voltage_max;
+ curr.requested_current =
+ batt_info->precharge_current;
+ } else
+#endif
if (curr.state == ST_PRECHARGE ||
battery_seems_to_be_dead) {
CPRINTS("battery woke up");