summaryrefslogtreecommitdiff
path: root/drivers/thermal/int340x_thermal/int3403_thermal.c
diff options
context:
space:
mode:
authorlan,Tianyu <tianyu.lan@intel.com>2014-11-03 12:53:01 +0300
committerEduardo Valentin <edubezval@gmail.com>2014-11-05 02:17:32 +0300
commit225112a56942c74f1e114587719fa2bd0d180b3e (patch)
treead777dfc70d02672c86d67883aced13c5614a4d2 /drivers/thermal/int340x_thermal/int3403_thermal.c
parenta1cff6e25e6e3b55183610dddca91546951b20e3 (diff)
downloadlinux-225112a56942c74f1e114587719fa2bd0d180b3e.tar.xz
Thermal/int3403: Fix thermal hysteresis unit conversion
Thermal hysteresis represents a temperature difference. But the original code treats it as a temperature value, Convert it from tenths of degree Kelvin to Milli-Celsius by deducing 273200. This is not right. Kelvin and Celsius have same degree size. From temperature difference view, the conversion between tenths of degree Kelvin unit and Milli-Celsius unit is just to multiply 100. Signed-off-by: Lan Tianyu <tianyu.lan@intel.com> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
Diffstat (limited to 'drivers/thermal/int340x_thermal/int3403_thermal.c')
-rw-r--r--drivers/thermal/int340x_thermal/int3403_thermal.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/thermal/int340x_thermal/int3403_thermal.c b/drivers/thermal/int340x_thermal/int3403_thermal.c
index d20dba986f0f..6e9fb62eb817 100644
--- a/drivers/thermal/int340x_thermal/int3403_thermal.c
+++ b/drivers/thermal/int340x_thermal/int3403_thermal.c
@@ -92,7 +92,13 @@ static int sys_get_trip_hyst(struct thermal_zone_device *tzone,
if (ACPI_FAILURE(status))
return -EIO;
- *temp = DECI_KELVIN_TO_MILLI_CELSIUS(hyst, KELVIN_OFFSET);
+ /*
+ * Thermal hysteresis represents a temperature difference.
+ * Kelvin and Celsius have same degree size. So the
+ * conversion here between tenths of degree Kelvin unit
+ * and Milli-Celsius unit is just to multiply 100.
+ */
+ *temp = hyst * 100;
return 0;
}