From 40cec762a65bb900a5afcedf609ba263ec92f3f4 Mon Sep 17 00:00:00 2001 From: Jianhong Chen Date: Mon, 13 Jul 2015 22:26:29 +0800 Subject: [PATCH] power: rk81x-battery: modify low power check threshold voltage MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jianhong Chen Signed-off-by: 许盛飞 --- drivers/power/rk818_battery.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/power/rk818_battery.c b/drivers/power/rk818_battery.c index 8b2fd397cfc2..b75bdb918fba 100644 --- a/drivers/power/rk818_battery.c +++ b/drivers/power/rk818_battery.c @@ -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; } -- 2.34.1