diff options
author | Rupesh Kumar <rupesh.kumar@stericsson.com> | 2012-08-22 15:14:22 +0530 |
---|---|---|
committer | Mathieu J. Poirier <mathieu.poirier@linaro.org> | 2012-09-25 09:40:09 -0600 |
commit | c45d4556038386b19cffacf799e46107366a12e8 (patch) | |
tree | 945b3d8ff412636234c66d94331afa4df5884c84 | |
parent | c8d2b3b95d04ef323d0c7301969e6b34bd1b78b3 (diff) |
power: ab8500: defer btemp filtering while init
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.
This patch defers btemp filtering till init is done.
Signed-off-by: Rupesh Kumar <rupesh.kumar@stericsson.com>
Signed-off-by: Mathieu Poirier <mathieu.poirier@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>
-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 b24835f1a856..1f33122424d9 100644 --- a/drivers/power/ab8500_btemp.c +++ b/drivers/power/ab8500_btemp.c @@ -613,7 +613,6 @@ static void ab8500_btemp_periodic_work(struct work_struct *work) struct ab8500_btemp, btemp_periodic_work.work); if (!di->initialized) { - di->initialized = true; /* Identify the battery */ if (ab8500_btemp_id(di) < 0) dev_warn(di->dev, "failed to identify the battery\n"); @@ -626,8 +625,9 @@ static void ab8500_btemp_periodic_work(struct work_struct *work) * same temperature. Else only allow 1 degree change from previous * reported value in the direction of the new measurement. */ - if (bat_temp == di->prev_bat_temp || !di->initialized) { - if (di->bat_temp != di->prev_bat_temp || !di->initialized) { + if ((bat_temp == di->prev_bat_temp) || !di->initialized) { + if ((di->bat_temp != di->prev_bat_temp) || !di->initialized) { + di->initialized = true; di->bat_temp = bat_temp; power_supply_changed(&di->btemp_psy); } |