aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuosong Su <gssu@marvell.com>2015-06-29 16:09:18 +0800
committerTim Wang <wangtt@marvell.com>2015-07-06 17:28:52 +0800
commit83ede70eba04c9d8628a32952acba4693e8bbbee (patch)
tree4b57f6bf5b0fd5ea1d322f4d868ec2e0732352ae
parent47ebe8d0c2279eb7bdd3e15a2946ad705a3840ca (diff)
downloadpxa-v3.14-83ede70eba04c9d8628a32952acba4693e8bbbee.tar.gz
power: 88pm88x_battery: fix the bug of poweroff issues
if battery voltage is lower than poweroff threshold, we should reduce SoC every 5 seconds, otherwise battery will be exhaust. codes present use real_soc even it is not low temperature, that is not what we need. Change-Id: Ie5ea1b854b6ff82d2f0491728ac5487f48792157 Signed-off-by: Guosong Su <gssu@marvell.com>
-rw-r--r--drivers/power/88pm88x_battery.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/power/88pm88x_battery.c b/drivers/power/88pm88x_battery.c
index 464a47f9e54..dc393ec5e35 100644
--- a/drivers/power/88pm88x_battery.c
+++ b/drivers/power/88pm88x_battery.c
@@ -1086,8 +1086,11 @@ static void pm88x_battery_correct_low_temp(struct pm88x_battery_info *info,
/* offset are multipled by 10 times becasue the soc now is 1000% */
offset *= PM88X_CAP_FAC1000;
- ccnt_val->soc = ccnt_val->real_soc * times;
- ccnt_val->soc -= offset;
+ /* only do this at low temperature */
+ if (info->bat_params.temp < 0) {
+ ccnt_val->soc = ccnt_val->real_soc * times;
+ ccnt_val->soc -= offset;
+ }
}
/* correct SoC according to temp */