Commit 696b6075 authored by Ezequiel Garcia's avatar Ezequiel Garcia Committed by Zhang Rui

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: default avatarLior Amsalem <alior@marvell.com>
Signed-off-by: default avatarEzequiel Garcia <ezequiel.garcia@free-electrons.com>
Acked-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
parent 02519d33
...@@ -49,13 +49,13 @@ static int kirkwood_get_temp(struct thermal_zone_device *thermal, ...@@ -49,13 +49,13 @@ static int kirkwood_get_temp(struct thermal_zone_device *thermal,
} }
/* /*
* Calculate temperature. See Section 8.10.1 of the 88AP510, * Calculate temperature. According to Marvell internal
* datasheet, which has the same sensor. * documentation the formula for this is:
* Documentation/arm/Marvell/README * Celsius = (322-reg)/1.3625
*/ */
reg = (reg >> KIRKWOOD_THERMAL_TEMP_OFFSET) & reg = (reg >> KIRKWOOD_THERMAL_TEMP_OFFSET) &
KIRKWOOD_THERMAL_TEMP_MASK; KIRKWOOD_THERMAL_TEMP_MASK;
*temp = ((2281638UL - (7298*reg)) / 10); *temp = ((3220000000UL - (10000000UL * reg)) / 13625);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment