From 7a4eac1bed523e0f37597efcf1b887d996a037f0 Mon Sep 17 00:00:00 2001 From: Daisuke Nojiri Date: Wed, 25 Jan 2017 10:39:09 -0800 Subject: Reef: Reduce max battery charge voltage for 0.5% margin (From CL 431233) Limit battery charge voltage to prevent battery over-charge, due to regulation inaccuracy. Since RO FW may charge > 8656 mV, ensure the battery is not full before charging. BUG=chrome-os-partner:61906 BRANCH=none TEST=Manual on Electro, sysjump with battery @ 99%, verify battery discharges, then re-charges to 100%, before discharging once again. Change-Id: I28212c83057a442fd75e39f8ad51927a7a1f2817 Signed-off-by: Daisuke Nojiri Reviewed-on: https://chromium-review.googlesource.com/432857 Reviewed-by: Aaron Durbin --- board/reef/battery.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'board/reef') diff --git a/board/reef/battery.c b/board/reef/battery.c index 602834257a..a76bd92d1d 100644 --- a/board/reef/battery.c +++ b/board/reef/battery.c @@ -11,6 +11,7 @@ #include "charge_ramp.h" #include "charge_state.h" #include "charger_profile_override.h" +#include "common.h" #include "console.h" #include "ec_commands.h" #include "extpower.h" @@ -118,7 +119,7 @@ static const struct fast_charge_params fast_chg_params_smp_cos4870 = { }; const struct battery_info batt_info_smp_cos4870 = { - .voltage_max = 8700, /* mV */ + .voltage_max = TARGET_WITH_MARGIN(8700, 5), .voltage_normal = 7600, /* * Actual value 6000mV, added 100mV for charger accuracy so that @@ -162,7 +163,7 @@ static const struct fast_charge_params fast_chg_params_sonycorp = { }; const struct battery_info batt_info_sonycorp = { - .voltage_max = 8700, /* mV */ + .voltage_max = TARGET_WITH_MARGIN(8700, 5), .voltage_normal = 7600, /* @@ -216,7 +217,7 @@ static const struct fast_charge_params fast_chg_params_panasonic = { }; const struct battery_info batt_info_panasoic = { - .voltage_max = 8800, /* mV */ + .voltage_max = TARGET_WITH_MARGIN(8800, 5), .voltage_normal = 7700, /* @@ -324,7 +325,7 @@ static const struct fast_charge_params fast_chg_params_cpt_c22n1626 = { }; const struct battery_info batt_info_c22n1626 = { - .voltage_max = 8800, /* mV */ + .voltage_max = TARGET_WITH_MARGIN(8800, 5), .voltage_normal = 7700, /* -- cgit v1.2.1