All of lore.kernel.org
 help / color / mirror / Atom feed
* [lm-sensors] [PATCH] k8temp - Add the diode offset to reported
@ 2007-04-16 15:14 Amul Shah
  2007-04-17 13:49 ` Amul Shah
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Amul Shah @ 2007-04-16 15:14 UTC (permalink / raw)
  To: lm-sensors

This patch adds support to include the CPU diode sensor offset when
reporting CPU temperature.

Please see http://www.lm-sensors.org/ticket/2200 for the full problem
description.

Signed-off-by: Amul Shah <amul.shah@unisys.com>
---
diff -uprN kernel.orig/drivers/hwmon/k8temp.c kernel/drivers/hwmon/k8temp.c
--- kernel.orig/drivers/hwmon/k8temp.c	2007-04-12 23:15:02.000000000 -0400
+++ kernel/drivers/hwmon/k8temp.c	2007-04-16 14:15:06.000000000 -0400
@@ -33,6 +33,8 @@
 #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)) * 1000):0)
 #define REG_TEMP	0xe4
 #define SEL_PLACE	0x40
 #define SEL_CORE	0x04
@@ -117,7 +119,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]));
+		       TEMP_FROM_REG(data->temp[core][place]) +
+		       OFFSET_FROM_REG(data->temp[core][place]));
 }
 
 /* core, place */



_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-05-17  0:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-16 15:14 [lm-sensors] [PATCH] k8temp - Add the diode offset to reported Amul Shah
2007-04-17 13:49 ` Amul Shah
2007-04-17 16:24 ` Rudolf Marek
2007-04-19 12:31 ` Jean Delvare
2007-05-17  0:06 ` Philip Pokorny

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.