Add the temp offset diode register to the k8temp
Subsystems (2)
[CC'ing the lm-sensors list in case the Documentation/hwmon/k8temp documentation is out of date]
Hi Rudolf,
I have attached my patch (sorry gmail always screws them up for me) to have the k8temp utilize the temperature diode offset when calculating the reported temperature.
Short Story:
I started looking at this because the k8temp driver reported temperatures that were very different from those reported by the BIOS. Since I couldn't make heads or tails of why the numbers were wrong, I read the spec sheet and the driver source. I came up with the changes based on spec sheet (see my bug report). The temperature reported by k8temp is not the same as the BIOS, but both CPU temps are uniformly 6 degrees C lower than BIOS reported temps. The diode offset corrects CPU1 by 4 and CPU 2 by 7.
I was wondering what you thought of my changes.
For the long story , please see http://www.lm-sensors.org/ticket/2200 .
thanks,
Amul
drivers/hwmon/k8temp.c +3 -1
@@ -33,6 +33,7 @@#include <linux/mutex.h> #define TEMP_FROM_REG (val) (((((val) >> 16) & 0xff) - 49) * 1000) +#define OFFSET_FROM_REG (val) ((val >> 8) & 0x3f)?(11 - ((val >> 8) & 0x3f)):0#define REG_TEMP 0xe4#define SEL_PLACE 0x40#define SEL_CORE 0x04
@@ -117,7 +118,8 @@ static ssize_t show_temp(struct device *struct k8temp_data *data =k8temp_update_device (dev);return sprintf (buf,"%d\n" , -TEMP_FROM_REG (data->temp[core][place])); + ((int )TEMP_FROM_REG (data->temp[core][place])) + + (((int )OFFSET_FROM_REG (data->temp[core][place]))*1000 )); }/* core, place */
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors