diff options
author | Lee Jones <lee.jones@linaro.org> | 2013-01-11 13:12:56 +0000 |
---|---|---|
committer | Anton Vorontsov <anton@enomsg.org> | 2013-01-15 17:44:28 -0800 |
commit | 5b41aa9f2b3a4e44ca4f68cd3076856bd3d93462 (patch) | |
tree | ac47729034c49bbdf8e8e83dd4e68db7a1f424cf /drivers/power/ab8500_btemp.c | |
parent | 129d583b4432375a9559708882172320e4c8fb94 (diff) |
ab8500_btemp: Allign battery temperature resolution with the framework
The Linux Power Supply framework expects battery temperatures to have
a resolution of 0.1 degree Celsius; however, the AB8500 btemp driver
supplies a battery temperature resolution of 1 degree Celsius. We
therefore have to use a factor 10 on the measured values.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
Diffstat (limited to 'drivers/power/ab8500_btemp.c')
-rw-r--r-- | drivers/power/ab8500_btemp.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/power/ab8500_btemp.c b/drivers/power/ab8500_btemp.c index 4a570b6c9e4..adebf6c6d14 100644 --- a/drivers/power/ab8500_btemp.c +++ b/drivers/power/ab8500_btemp.c @@ -746,22 +746,22 @@ static int ab8500_btemp_get_temp(struct ab8500_btemp *di) } else { if (di->events.btemp_low) { if (temp > di->btemp_ranges.btemp_low_limit) - temp = di->btemp_ranges.btemp_low_limit; + temp = di->btemp_ranges.btemp_low_limit * 10; else temp = di->bat_temp * 10; } else if (di->events.btemp_high) { if (temp < di->btemp_ranges.btemp_high_limit) - temp = di->btemp_ranges.btemp_high_limit; + temp = di->btemp_ranges.btemp_high_limit * 10; else temp = di->bat_temp * 10; } else if (di->events.btemp_lowmed) { if (temp > di->btemp_ranges.btemp_med_limit) - temp = di->btemp_ranges.btemp_med_limit; + temp = di->btemp_ranges.btemp_med_limit * 10; else temp = di->bat_temp * 10; } else if (di->events.btemp_medhigh) { if (temp < di->btemp_ranges.btemp_med_limit) - temp = di->btemp_ranges.btemp_med_limit; + temp = di->btemp_ranges.btemp_med_limit * 10; else temp = di->bat_temp * 10; } else @@ -1030,8 +1030,8 @@ static int ab8500_btemp_probe(struct platform_device *pdev) ab8500_btemp_periodic_work); /* Set BTEMP thermal limits. Low and Med are fixed */ - di->btemp_ranges.btemp_low_limit = BTEMP_THERMAL_LOW_LIMIT; - di->btemp_ranges.btemp_med_limit = BTEMP_THERMAL_MED_LIMIT; + di->btemp_ranges.btemp_low_limit = BTEMP_THERMAL_LOW_LIMIT * 10; + di->btemp_ranges.btemp_med_limit = BTEMP_THERMAL_MED_LIMIT * 10; ret = abx500_get_register_interruptible(di->dev, AB8500_CHARGER, AB8500_BTEMP_HIGH_TH, &val); |