Commit 2e17cc3a authored by Jean Delvare's avatar Jean Delvare Committed by Greg Kroah-Hartman

[PATCH] I2C: fix for previous lm83 driver update

Signed-off-by: Jean Delvare <khali at linux-fr dot org>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent 74303598
......@@ -83,10 +83,10 @@ SENSORS_INSMOD_1(lm83);
* The LM83 uses signed 8-bit values.
*/
#define TEMP_FROM_REG(val) (((val) > 127 ? (val)-0xFF : (val)) * 1000)
#define TEMP_TO_REG(val) ((val) <= -50000 ? -50 + 0xFF : (val) >= 127000 ? 127 : \
#define TEMP_FROM_REG(val) (((val) > 127 ? (val) - 0x100 : (val)) * 1000)
#define TEMP_TO_REG(val) ((val) <= -50000 ? -50 + 0x100 : (val) >= 127000 ? 127 : \
(val) > -500 ? ((val)+500) / 1000 : \
((val)-500) / 1000 + 0xFF)
((val)-500) / 1000 + 0x100)
static const u8 LM83_REG_R_TEMP[] = {
LM83_REG_R_LOCAL_TEMP,
......
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