summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYongBeum Ha <ybha@samsung.com>2019-05-10 15:06:27 +0900
committerCommit Bot <commit-bot@chromium.org>2019-05-23 15:45:53 +0000
commitd0ad4c7d1d919e683ca3d24e15145b501dcfaaad (patch)
tree8bbce7c9584abd9a33eb1c350a191fadf691b9e4
parentf37d0b316074cd48f3255a4df94c292b6f6c19af (diff)
downloadchrome-ec-d0ad4c7d1d919e683ca3d24e15145b501dcfaaad.tar.gz
casta:Do not override charge on dead battery
charger_profile_override() change charging voltage & current as battery temperature. The flag for bad temperature is set when battery is not responsive then the current is set to 0. Charge doesnot charge dead battery and the battery can't wake. Then the system can't power on with dead battery. BUG=b:131126731 BRANCH=octopus TEST=flash EC and check if dead battery is charged. Change-Id: I3a46442344f89d129c4b90b0b7ceb9ffc863fbf3 Signed-off-by: YongBeum Ha <ybha@samsung.com> Reviewed-on: https://chromium-review.googlesource.com/1605298 Tested-by: YongBeum.Ha <ybha@samsung.corp-partner.google.com> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: YongBeum.Ha <ybha@samsung.corp-partner.google.com> (cherry picked from commit bd7bcb8a50da51032b73ca6b3990fc36955980e7) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1626313 Commit-Queue: Diana Z <dzigterman@chromium.org> Tested-by: Diana Z <dzigterman@chromium.org>
-rw-r--r--board/casta/battery.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/board/casta/battery.c b/board/casta/battery.c
index 7cb6dff4c6..abed3481ef 100644
--- a/board/casta/battery.c
+++ b/board/casta/battery.c
@@ -93,6 +93,13 @@ int charger_profile_override(struct charge_state_data *curr)
TEMP_OUT_OF_RANGE = TEMP_ZONE_COUNT
} temp_zone;
+ /*
+ * Precharge must be executed when communication is failed on
+ * dead battery.
+ */
+ if(!(curr->batt.flags & BATT_FLAG_RESPONSIVE))
+ return 0;
+
current = curr->requested_current;
voltage = curr->requested_voltage;
bat_temp_c = curr->batt.temperature - 2731;