power: rk81x-battery: modify low power check threshold voltage

Signed-off-by: Jianhong Chen <chenjh@rock-chips.com>
Signed-off-by: 许盛飞 <xsf@rock-chips.com>
This commit is contained in:
Jianhong Chen
2015-07-13 22:26:29 +08:00
committed by 许盛飞
parent d189c1ff7c
commit 40cec762a6

View File

@@ -1268,7 +1268,7 @@ static void rk81x_bat_set_power_supply_state(struct rk81x_battery *di,
static void rk81x_bat_lowpwr_check(struct rk81x_battery *di)
{
static u64 time;
int pwr_off_thresd = di->pdata->power_off_thresd - 50;
int pwr_off_thresd = di->pdata->power_off_thresd;
if (di->current_avg < 0 && di->voltage < pwr_off_thresd) {
if (!time)
@@ -1278,6 +1278,11 @@ static void rk81x_bat_lowpwr_check(struct rk81x_battery *di)
rk81x_bat_set_power_supply_state(di, NO_CHARGER);
dev_info(di->dev, "low power....\n");
}
if (di->voltage <= pwr_off_thresd - 50) {
di->dsoc--;
rk81x_bat_set_power_supply_state(di, NO_CHARGER);
}
} else {
time = 0;
}