diff options
author | Rupesh Kumar <rupesh.kumar@stericsson.com> | 2012-08-22 05:44:22 -0400 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2013-03-06 23:35:47 -0500 |
commit | 2c4c40ac0052eaf9b14009635ab475362e88c6e0 (patch) | |
tree | 5e4c4c92c59fb54c15051fd6c774d8dbd29125f4 /drivers/power | |
parent | db43e6c473b57d4e7a55c4bd6edef71f40f13eae (diff) |
ab8500-btemp: Defer btemp filtering while initialising
Due to btemp filtering enabled during init, temp values reported
to charge algorithm driver started from 0. As a result,charge
algorithm was going into wrong state and charging was stopped.
Signed-off-by: Rupesh Kumar <rupesh.kumar@stericsson.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Reviewed-by: Marcus COOPER <marcus.xm.cooper@stericsson.com>
Reviewed-by: Martin SJOBLOM <martin.w.sjoblom@stericsson.com>
Reviewed-by: Philippe LANGLAIS <philippe.langlais@stericsson.com>
Diffstat (limited to 'drivers/power')
-rw-r--r-- | drivers/power/ab8500_btemp.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/power/ab8500_btemp.c b/drivers/power/ab8500_btemp.c index fa60e3ac33a3..91ad3edf6197 100644 --- a/drivers/power/ab8500_btemp.c +++ b/drivers/power/ab8500_btemp.c | |||
@@ -609,7 +609,6 @@ static void ab8500_btemp_periodic_work(struct work_struct *work) | |||
609 | struct ab8500_btemp, btemp_periodic_work.work); | 609 | struct ab8500_btemp, btemp_periodic_work.work); |
610 | 610 | ||
611 | if (!di->initialized) { | 611 | if (!di->initialized) { |
612 | di->initialized = true; | ||
613 | /* Identify the battery */ | 612 | /* Identify the battery */ |
614 | if (ab8500_btemp_id(di) < 0) | 613 | if (ab8500_btemp_id(di) < 0) |
615 | dev_warn(di->dev, "failed to identify the battery\n"); | 614 | dev_warn(di->dev, "failed to identify the battery\n"); |
@@ -622,8 +621,9 @@ static void ab8500_btemp_periodic_work(struct work_struct *work) | |||
622 | * same temperature. Else only allow 1 degree change from previous | 621 | * same temperature. Else only allow 1 degree change from previous |
623 | * reported value in the direction of the new measurement. | 622 | * reported value in the direction of the new measurement. |
624 | */ | 623 | */ |
625 | if (bat_temp == di->prev_bat_temp || !di->initialized) { | 624 | if ((bat_temp == di->prev_bat_temp) || !di->initialized) { |
626 | if (di->bat_temp != di->prev_bat_temp || !di->initialized) { | 625 | if ((di->bat_temp != di->prev_bat_temp) || !di->initialized) { |
626 | di->initialized = true; | ||
627 | di->bat_temp = bat_temp; | 627 | di->bat_temp = bat_temp; |
628 | power_supply_changed(&di->btemp_psy); | 628 | power_supply_changed(&di->btemp_psy); |
629 | } | 629 | } |