]> git.baikalelectronics.ru Git - kernel.git/commit
hwmon: (lm95241) Fix negative temperature results
authorGuenter Roeck <guenter.roeck@ericsson.com>
Thu, 30 Jun 2011 09:09:37 +0000 (02:09 -0700)
committerGuenter Roeck <guenter.roeck@ericsson.com>
Sun, 10 Jul 2011 15:54:15 +0000 (08:54 -0700)
commitbd874851ecb6e540742f37e85ecb131770bbd9f6
treeca3d7268acc38bf2549dc53be8c96df98560cfd4
parentef398ac528e58d4034a0beb7daf4bfe6bc475d1e
hwmon: (lm95241) Fix negative temperature results

Negative temperatures were returned in degrees C instead of milli-Degrees C.
Also, negative temperatures were reported for remote temperature sensors even
if the chip was configured for positive-only results.

Fix by detecting temperature modes, and by treating negative temperatures
similar to positive temperatures, with appropriate sign extension.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Cc: stable@kernel.org # 2.6.30+
drivers/hwmon/lm95241.c