From 696b6075afa97b42b3f59f96809ed586eb691c96 Mon Sep 17 00:00:00 2001 From: Ezequiel Garcia Date: Fri, 22 Mar 2013 09:23:02 -0300 Subject: thermal: kirkwood: Fix thermal sensor formula The currently formula has been taken from the 88AP510 SoC datasheet, which is not exactly correct. The correct value for the temperature in Celcius of the sensor present in this SoC is: Celsius = (322-reg)/1.3625 Signed-off-by: Lior Amsalem Signed-off-by: Ezequiel Garcia Acked-by: Andrew Lunn Signed-off-by: Zhang Rui --- drivers/thermal/kirkwood_thermal.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/thermal/kirkwood_thermal.c') diff --git a/drivers/thermal/kirkwood_thermal.c b/drivers/thermal/kirkwood_thermal.c index d2e05eec722a..dfeceaffbc03 100644 --- a/drivers/thermal/kirkwood_thermal.c +++ b/drivers/thermal/kirkwood_thermal.c @@ -49,13 +49,13 @@ static int kirkwood_get_temp(struct thermal_zone_device *thermal, } /* - * Calculate temperature. See Section 8.10.1 of the 88AP510, - * datasheet, which has the same sensor. - * Documentation/arm/Marvell/README + * Calculate temperature. According to Marvell internal + * documentation the formula for this is: + * Celsius = (322-reg)/1.3625 */ reg = (reg >> KIRKWOOD_THERMAL_TEMP_OFFSET) & KIRKWOOD_THERMAL_TEMP_MASK; - *temp = ((2281638UL - (7298*reg)) / 10); + *temp = ((3220000000UL - (10000000UL * reg)) / 13625); return 0; } -- cgit v1.2.3-55-g7522