summaryrefslogtreecommitdiff
path: root/common/charge_state_v2.c
diff options
context:
space:
mode:
authorAlec Berg <alecaberg@chromium.org>2014-07-01 11:37:04 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-07-11 01:55:13 +0000
commit6ab38d8715bb49753b98b21f5430c6986dc12cf2 (patch)
treea5849e121cb2a410bc10d94eb3d0d75083e0a6a4 /common/charge_state_v2.c
parentbc4973c1f9a49d8ce17b42a74e7373f2a8e8ca09 (diff)
downloadchrome-ec-6ab38d8715bb49753b98b21f5430c6986dc12cf2.tar.gz
samus: use real AC_PRESENT signal
Revert - https://chromium-review.googlesource.com/#/c/205145/2 - https://chromium-review.googlesource.com/#/c/205147/4 Now using the real AC_PRESENT gpio signal instead of whether or not the PD MCU negotiated for 20V. BUG=chrome-os-partner:29841, chrome-os-partner:29842 BRANCH=none TEST=tested on a board with reworked AC_PRESENT signal. Verified that gpio is correctly reporting state of AC and is charging when AC is plugged in. Tested the no battery case to make sure board powers on and stays on with just a charger. Also tested the dead battery case by plugging in a dead battery, then plugging in a charger and making sure system powers on and starts charging. Change-Id: I4424771c91c8a2aa19eda68a8b5194e9265d529c Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/206598 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'common/charge_state_v2.c')
-rw-r--r--common/charge_state_v2.c41
1 files changed, 0 insertions, 41 deletions
diff --git a/common/charge_state_v2.c b/common/charge_state_v2.c
index 5b9d32ba89..c44d05e096 100644
--- a/common/charge_state_v2.c
+++ b/common/charge_state_v2.c
@@ -400,23 +400,6 @@ static inline int battery_too_low(void)
curr.batt.voltage <= batt_info->voltage_min));
}
-#ifdef BOARD_SAMUS
-/*
- * TODO(crosbug.com/p/29842): remove this workaround once the AC_PRESENT
- * input is avaible.
- */
-static void check_deep_discharge_again(void)
-{
- /* Check again if power is present */
- if (!extpower_is_present()) {
- /* AP is off, so shut down the EC now */
- CPRINTS("charge force EC hibernate due to low battery");
- system_hibernate(0, 0);
- }
-}
-DECLARE_DEFERRED(check_deep_discharge_again);
-#endif
-
/* Shut everything down before the battery completely dies. */
static void prevent_deep_discharge(void)
{
@@ -424,17 +407,9 @@ static void prevent_deep_discharge(void)
return;
if (chipset_in_state(CHIPSET_STATE_ANY_OFF)) {
-#ifdef BOARD_SAMUS
- /*
- * TODO(crosbug.com/p/29842): remove this workaround once
- * the AC_PRESENT input is avaible.
- */
- hook_call_deferred(check_deep_discharge_again, 10*SECOND);
-#else
/* AP is off, so shut down the EC now */
CPRINTS("charge force EC hibernate due to low battery");
system_hibernate(0, 0);
-#endif
} else if (!shutdown_warning_time.val) {
/* Warn AP battery level is so low we'll shut down */
CPRINTS("charge warn shutdown due to low battery");
@@ -510,27 +485,11 @@ void charger_task(void)
problem(PR_POST_INIT, rv);
else
prev_ac = curr.ac;
-#ifdef BOARD_SAMUS
- /*
- * TODO(crosbug.com/p/29841): remove hack for
- * getting extpower is present status from PD.
- */
- CPRINTS("AC connected");
- host_set_single_event(EC_HOST_EVENT_AC_CONNECTED);
-#endif
} else {
/* Some things are only meaningful on AC */
state_machine_force_idle = 0;
battery_seems_to_be_dead = 0;
prev_ac = curr.ac;
-#ifdef BOARD_SAMUS
- /*
- * TODO(crosbug.com/p/29841): remove hack for
- * getting extpower is present status from PD.
- */
- CPRINTS("AC disconnected");
- host_set_single_event(EC_HOST_EVENT_AC_DISCONNECTED);
-#endif
}
}
charger_get_params(&curr.chg);