Skip to contentSkip to conversation

Add lm78 sensor chip support (2.5.70)

RFC PATCH Applied Mark M. Hoffman 2 participants 4 messages Jun 8, 2003 – Jun 16, 2003

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 Add lm78 sensor chip support (2.5.70)

This patch vs. 2.5.70 adds support for LM78, LM78-J, and LM79 sensors chips based on lm_sensors project CVS. This works on one of my boards.

I want to draw attention to something I did with this driver by comparing it to it87.c in 2.5.70:

Quoted 2 lines

#define IT87_INIT_TEMP_HIGH_1 600
#define IT87_INIT_TEMP_LOW_1 200

The hardware uses degrees C, and sysfs uses degrees C * 1000. But these #defines are apparently in units of degrees C * 10. This arbitrary intermediate representation bugs me. And given the new 2.5 sysfs standard, it's unnecessary.

In this patch for lm78, I rewrote the conversion routines in terms of the sysfs units - getting rid of the intermediate nonsense. If there are no objections, I'm going to start passing patches to do this to the other sensor chip drivers in 2.5 as well. It would be nice to get some help with this too... especially since I don't have all that hardware at hand to test the results.

Regards,

Signature · 2 lines
Mark M. Hoffman
[email protected]
drivers/i2c/chips/Kconfig +14 -0
diff --exclude-from /home/mark/exclude -Nru linux-2.5.70-orig/drivers/i2c/chips/Kconfig linux-2.5.70/drivers/i2c/chips/Kconfig
@@ -47,6 +47,20 @@
 	  in the lm_sensors package, which you can download at 
 	  http://www.lm-sensors.nu
 	  
+config SENSORS_LM78
+	tristate "  National Semiconductors LM78 and compatibles"
+	depends on I2C && EXPERIMENTAL
+	help
+	  If you say yes here you get support for National Semiconductor LM78,
+	  LM78-J and LM79.  This can also be built as a module which can be
+	  inserted and removed while the kernel is running.
+
+	  The module will be called lm78.
+
+	  You will also need the latest user-space utilties: you can find them
+	  in the lm_sensors package, which you can download at 
+	  http://www.lm-sensors.nu
+	  
 config SENSORS_VIA686A
 	tristate "  VIA686A"
 	depends on I2C && EXPERIMENTAL
drivers/i2c/chips/lm78.c +895 -0

895 lines not on this page · raw message

drivers/i2c/chips/Makefile +1 -0
diff --exclude-from /home/mark/exclude -Nru linux-2.5.70-orig/drivers/i2c/chips/Makefile linux-2.5.70/drivers/i2c/chips/Makefile
@@ -5,5 +5,6 @@
 obj-$(CONFIG_SENSORS_ADM1021)	+= adm1021.o
 obj-$(CONFIG_SENSORS_IT87)	+= it87.o
 obj-$(CONFIG_SENSORS_LM75)	+= lm75.o
+obj-$(CONFIG_SENSORS_LM78)	+= lm78.o
 obj-$(CONFIG_SENSORS_VIA686A)	+= via686a.o
 obj-$(CONFIG_SENSORS_W83781D)	+= w83781d.o
#1 lore raw
Quoted 2 lines · Mark M. Hoffman

This patch vs. 2.5.70 adds support for LM78, LM78-J, and LM79 sensors chips based on lm_sensors project CVS. This works on one of my boards.

Do you want me to add this to the kernel tree? Sorry I missed this in the last round of i2c patches I sent out.

thanks,

greg k-h

#2 lore raw
Quoted 6 lines · Greg KH
Quoted 2 lines · Mark M. Hoffman

This patch vs. 2.5.70 adds support for LM78, LM78-J, and LM79 sensors chips based on lm_sensors project CVS. This works on one of my boards.

Do you want me to add this to the kernel tree? Sorry I missed this in the last round of i2c patches I sent out.

I was hoping to get some feedback w.r.t. the conversion routines... but I guess silence is consent. Please pass this on in the next round. No worries, btw.

Thanks and regards,

Signature · 2 lines
Mark M. Hoffman
[email protected]
Applied
#3 lore raw
In reply to Mark M. Hoffman
Quoted 14 lines · Mark M. Hoffman

This patch vs. 2.5.70 adds support for LM78, LM78-J, and LM79 sensors chips based on lm_sensors project CVS. This works on one of my boards.

I want to draw attention to something I did with this driver by comparing it to it87.c in 2.5.70:

Quoted 2 lines

#define IT87_INIT_TEMP_HIGH_1 600
#define IT87_INIT_TEMP_LOW_1 200

The hardware uses degrees C, and sysfs uses degrees C * 1000. But these #defines are apparently in units of degrees C * 10. This arbitrary intermediate representation bugs me. And given the new 2.5 sysfs standard, it's unnecessary.

Quoted 6 lines

In this patch for lm78, I rewrote the conversion routines in terms of the sysfs units - getting rid of the intermediate nonsense. If there are no objections, I'm going to start passing patches to do this to the other sensor chip drivers in 2.5 as well. It would be nice to get some help with this too... especially since I don't have all that hardware at hand to test the results.

Applied, thanks.

greg k-h