diff options
author | lan,Tianyu <tianyu.lan@intel.com> | 2014-04-03 02:04:15 -0400 |
---|---|---|
committer | Zhang Rui <rui.zhang@intel.com> | 2014-05-15 04:38:48 -0400 |
commit | ced2284339580b50b997807d02ccee19692b72b3 (patch) | |
tree | 013dac8a505e5def6b78c61a38f629ae8d89d332 | |
parent | d6d211db37e75de2ddc3a4f979038c40df7cc79c (diff) |
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>
-rw-r--r-- | drivers/thermal/int3403_thermal.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/thermal/int3403_thermal.c b/drivers/thermal/int3403_thermal.c index 1301681d9a77..e93f0253f6ed 100644 --- a/drivers/thermal/int3403_thermal.c +++ b/drivers/thermal/int3403_thermal.c | |||
@@ -62,7 +62,13 @@ static int sys_get_trip_hyst(struct thermal_zone_device *tzone, | |||
62 | if (ACPI_FAILURE(status)) | 62 | if (ACPI_FAILURE(status)) |
63 | return -EIO; | 63 | return -EIO; |
64 | 64 | ||
65 | *temp = DECI_KELVIN_TO_MILLI_CELSIUS(hyst, KELVIN_OFFSET); | 65 | /* |
66 | * Thermal hysteresis represents a temperature difference. | ||
67 | * Kelvin and Celsius have same degree size. So the | ||
68 | * conversion here between tenths of degree Kelvin unit | ||
69 | * and Milli-Celsius unit is just to multiply 100. | ||
70 | */ | ||
71 | *temp = hyst * 100; | ||
66 | 72 | ||
67 | return 0; | 73 | return 0; |
68 | } | 74 | } |