From 460f4f9ebb4e4ce464ffd1009184f5680ff22381 Mon Sep 17 00:00:00 2001 From: Frodo Looijaard Date: Mon, 10 Jan 2000 23:27:32 +0000 Subject: [PATCH] Fixed a temperature bug in the LM80 driver git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@691 7894878c-1315-0410-8ee3-d5d059ff63e0 --- kernel/chips/lm80.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/kernel/chips/lm80.c b/kernel/chips/lm80.c index e1536345..9d65e49d 100644 --- a/kernel/chips/lm80.c +++ b/kernel/chips/lm80.c @@ -101,13 +101,13 @@ extern inline long TEMP_FROM_REG(u16 temp) { long res; - temp= temp >> 4; + temp = temp >> 4; if (temp < 0x0800) { res = (625 * (long)temp); } else { res = ((long)temp - 0x01000) * 625; } - return res; + return res / 100; } #define TEMP_LIMIT_FROM_REG(val) (((val)>0x80?(val)-0x100:(val))*100) @@ -585,13 +585,13 @@ void lm80_temp(struct i2c_client *client, int operation, int ctl_name, { struct lm80_data *data = client->data; if (operation == SENSORS_PROC_REAL_INFO) - *nrels_mag = 4; + *nrels_mag = 2; else if (operation == SENSORS_PROC_REAL_READ) { lm80_update_client(client); - results[0] = TEMP_LIMIT_FROM_REG(data->temp_hot_max) * 10000; - results[1] = TEMP_LIMIT_FROM_REG(data->temp_hot_hyst) * 10000; - results[2] = TEMP_LIMIT_FROM_REG(data->temp_os_max) * 10000; - results[3] = TEMP_LIMIT_FROM_REG(data->temp_os_hyst) * 10000; + results[0] = TEMP_LIMIT_FROM_REG(data->temp_hot_max); + results[1] = TEMP_LIMIT_FROM_REG(data->temp_hot_hyst); + results[2] = TEMP_LIMIT_FROM_REG(data->temp_os_max); + results[3] = TEMP_LIMIT_FROM_REG(data->temp_os_hyst); results[4] = TEMP_FROM_REG(data->temp); *nrels_mag = 5; } else if (operation == SENSORS_PROC_REAL_WRITE) {