battery: the bug time-to-full
author许盛飞 <xsf@rock-chips.com>
Tue, 24 Sep 2013 09:01:53 +0000 (17:01 +0800)
committer许盛飞 <xsf@rock-chips.com>
Tue, 24 Sep 2013 09:01:53 +0000 (17:01 +0800)
drivers/power/rk30_factory_adc_battery.c

index 6276cf154746804f5eaf3cabc8fb9b7ad4227446..e1525661758380b7fb0a264462133bc398914303 100644 (file)
@@ -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++;