From f77a65799ca1cb0f2ee222b525846dca2953553a Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E8=AE=B8=E7=9B=9B=E9=A3=9E?= Date: Tue, 24 Sep 2013 17:01:53 +0800 Subject: [PATCH] battery: the bug time-to-full --- drivers/power/rk30_factory_adc_battery.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/power/rk30_factory_adc_battery.c b/drivers/power/rk30_factory_adc_battery.c index 6276cf154746..e15256617583 100644 --- a/drivers/power/rk30_factory_adc_battery.c +++ b/drivers/power/rk30_factory_adc_battery.c @@ -695,9 +695,10 @@ static int rk30_adc_battery_status_samples(struct rk30_adc_battery_data *bat) bat->time_to_full = get_seconds(); }else if(bat->bat_capacity == 99) { - if(get_seconds() - bat->time_to_full > 1800) + if(get_seconds() - bat->time_to_full > 1800){ bat->bat_capacity = 100; bat->time_to_full = 0; + } } @@ -709,6 +710,19 @@ static int rk30_adc_battery_status_samples(struct rk30_adc_battery_data *bat) bat->full_times = 0; bat->bat_status = POWER_SUPPLY_STATUS_CHARGING; + + if((bat->bat_capacity == 99)&&(bat->time_to_full == 0)){ + bat->time_to_full = get_seconds(); + }else if(bat->bat_capacity == 99) + { + if(get_seconds() - bat->time_to_full > 1800){ + bat->bat_capacity = 100; + bat->time_to_full = 0; + } + + } + + }else{ bat->full_times++; -- 2.34.1