summaryrefslogtreecommitdiff
path: root/common/charge_state_v2.c
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2021-05-25 18:09:34 -0700
committerCommit Bot <commit-bot@chromium.org>2021-07-15 02:40:33 +0000
commit5323adb2f6349fa605387e30d22ffcb887957f6d (patch)
tree47f71cc06b28a99ebcac2cd961cf524ca1bacff3 /common/charge_state_v2.c
parentdb95c62e5f0d057f49109b4f931244cc4c11c58a (diff)
downloadchrome-ec-5323adb2f6349fa605387e30d22ffcb887957f6d.tar.gz
chgstv2: Move battery validate code to battery.c
This patch moves the code validating battery parameters to battery.c. There is no functionality change. BUG=None BRANCH=None TEST=buildall Change-Id: I1706c4b504565b52964391077894665b4e5d1a86 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3007375 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'common/charge_state_v2.c')
-rw-r--r--common/charge_state_v2.c20
1 files changed, 1 insertions, 19 deletions
diff --git a/common/charge_state_v2.c b/common/charge_state_v2.c
index b169bb16f9..cc7dd9094d 100644
--- a/common/charge_state_v2.c
+++ b/common/charge_state_v2.c
@@ -1966,25 +1966,7 @@ void charger_task(void *u)
hook_notify(HOOK_BATTERY_SOC_CHANGE);
}
- /*
- * TODO(crosbug.com/p/27527). Sometimes the battery thinks its
- * temperature is 6280C, which seems a bit high. Let's ignore
- * anything above the boiling point of tungsten until this bug
- * is fixed. If the battery is really that warm, we probably
- * have more urgent problems.
- */
- if (curr.batt.temperature > CELSIUS_TO_DECI_KELVIN(5660)) {
- CPRINTS("ignoring ridiculous batt.temp of %dC",
- DECI_KELVIN_TO_CELSIUS(curr.batt.temperature));
- curr.batt.flags |= BATT_FLAG_BAD_TEMPERATURE;
- }
-
- /* If the battery thinks it's above 100%, don't believe it */
- if (curr.batt.state_of_charge > 100) {
- CPRINTS("ignoring ridiculous batt.soc of %d%%",
- curr.batt.state_of_charge);
- curr.batt.flags |= BATT_FLAG_BAD_STATE_OF_CHARGE;
- }
+ battery_validate_params(&curr.batt);
notify_host_of_over_current(&curr.batt);