summaryrefslogtreecommitdiffstats
path: root/sys/powerpc/powermac/smusat.c
diff options
context:
space:
mode:
authorloos <loos@FreeBSD.org>2016-05-22 13:58:32 +0000
committerloos <loos@FreeBSD.org>2016-05-22 13:58:32 +0000
commitf73b4006ff80acf9a60d242d6f438db07531ecfe (patch)
tree4ab2d9021cb5084e2afb4d7628a72937244d44e7 /sys/powerpc/powermac/smusat.c
parente0e5d3ee3792f1fe920a8174d18341c1a5f34afe (diff)
downloadFreeBSD-src-f73b4006ff80acf9a60d242d6f438db07531ecfe.zip
FreeBSD-src-f73b4006ff80acf9a60d242d6f438db07531ecfe.tar.gz
Fix the deciKelvin to Celsius conversion in kernel.
After r285994, sysctl(8) was fixed to use 273.15 instead of 273.20 as 0C reference and as result, the temperature read in sysctl(8) now exibits a +0.1C difference. This commit fix the kernel references to match the reference value used in sysctl(8) after r285994. Sponsored by: Rubicon Communications (Netgate)
Diffstat (limited to 'sys/powerpc/powermac/smusat.c')
-rw-r--r--sys/powerpc/powermac/smusat.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/powerpc/powermac/smusat.c b/sys/powerpc/powermac/smusat.c
index 2e37ae4..f8556ee 100644
--- a/sys/powerpc/powermac/smusat.c
+++ b/sys/powerpc/powermac/smusat.c
@@ -184,8 +184,8 @@ smusat_attach(device_t dev)
if (sens->type == SMU_TEMP_SENSOR) {
/* Make up some numbers */
- sens->therm.target_temp = 500 + 2732; /* 50 C */
- sens->therm.max_temp = 900 + 2732; /* 90 C */
+ sens->therm.target_temp = 500 + 2731; /* 50 C */
+ sens->therm.max_temp = 900 + 2731; /* 90 C */
sens->therm.read =
(int (*)(struct pmac_therm *))smusat_sensor_read;
pmac_thermal_sensor_register(&sens->therm);
@@ -248,7 +248,7 @@ smusat_sensor_read(struct smu_sensor *sens)
/* 16.16 */
value <<= 10;
/* From 16.16 to 0.1 C */
- value = 10*(value >> 16) + ((10*(value & 0xffff)) >> 16) + 2732;
+ value = 10*(value >> 16) + ((10*(value & 0xffff)) >> 16) + 2731;
break;
case SMU_VOLTAGE_SENSOR:
/* 16.16 */
OpenPOWER on IntegriCloud