[aadk-commits] dbailey: uClinux/trunk r146 - in /uClinux/trunk/uClinux-dist/linux-2.6.x/driv...

aadk-commits at lists.digium.com aadk-commits at lists.digium.com
Tue Feb 6 09:40:34 MST 2007


Author: dbailey
Date: Tue Feb  6 10:40:33 2007
New Revision: 146

URL: http://svn.digium.com/view/aadk?view=rev&rev=146
Log:
Modified the lm75 to be able to run with the adt75 temperature sensor. 
Added a config define to turn on those modifications.

Modified:
    uClinux/trunk/uClinux-dist/linux-2.6.x/drivers/hwmon/Kconfig
    uClinux/trunk/uClinux-dist/linux-2.6.x/drivers/hwmon/lm75.c
    uClinux/trunk/uClinux-dist/linux-2.6.x/drivers/i2c/busses/Kconfig

Modified: uClinux/trunk/uClinux-dist/linux-2.6.x/drivers/hwmon/Kconfig
URL: http://svn.digium.com/view/aadk/uClinux/trunk/uClinux-dist/linux-2.6.x/drivers/hwmon/Kconfig?view=diff&rev=146&r1=145&r2=146
==============================================================================
--- uClinux/trunk/uClinux-dist/linux-2.6.x/drivers/hwmon/Kconfig (original)
+++ uClinux/trunk/uClinux-dist/linux-2.6.x/drivers/hwmon/Kconfig Tue Feb  6 10:40:33 2007
@@ -203,6 +203,15 @@
 	  This driver can also be built as a module.  If so, the module
 	  will be called lm75.
 
+config SENSORS_ADT75_VARIANT
+	bool "Analog Devices ADT75 variant of LM75" 
+	depends on SENSORS_LM75
+	help
+	  If you say yes here, the LM75 driver is modified to allow for the 
+	  operation of the Analog Devices ADT75.  (Detection rules are loosended.) 
+
+	  The device driver continues to be called lm75.  
+
 config SENSORS_LM77
 	tristate "National Semiconductor LM77"
 	depends on HWMON && I2C && EXPERIMENTAL
@@ -433,6 +442,16 @@
 	  This driver can also be built as a module.  If so, the module
 	  will be called w83627ehf.
 
+config SENSORS_ADT75
+	tristate "Analog Devices ADT75 "
+	depends on HWMON && I2C
+	help
+	  If you say yes here you get support for Analog Device ADT75 
+	  sensor chip. 
+	  
+	  This driver can also be built as a module.  If so, the module
+	  will be called adt75.
+
 config SENSORS_HDAPS
 	tristate "IBM Hard Drive Active Protection System (hdaps)"
 	depends on HWMON && INPUT && X86

Modified: uClinux/trunk/uClinux-dist/linux-2.6.x/drivers/hwmon/lm75.c
URL: http://svn.digium.com/view/aadk/uClinux/trunk/uClinux-dist/linux-2.6.x/drivers/hwmon/lm75.c?view=diff&rev=146&r1=145&r2=146
==============================================================================
--- uClinux/trunk/uClinux-dist/linux-2.6.x/drivers/hwmon/lm75.c (original)
+++ uClinux/trunk/uClinux-dist/linux-2.6.x/drivers/hwmon/lm75.c Tue Feb  6 10:40:33 2007
@@ -26,7 +26,6 @@
 #include <linux/hwmon.h>
 #include <linux/err.h>
 #include "lm75.h"
-
 
 /* Addresses to scan */
 static unsigned short normal_i2c[] = { 0x48, 0x49, 0x4a, 0x4b, 0x4c,
@@ -114,7 +113,6 @@
 /* This function is called by i2c_probe */
 static int lm75_detect(struct i2c_adapter *adapter, int address, int kind)
 {
-	int i;
 	struct i2c_client *new_client;
 	struct lm75_data *data;
 	int err = 0;
@@ -147,7 +145,19 @@
 	   since it would significantly slow the detection down and would
 	   hardly add any value. */
 	if (kind < 0) {
-		int cur, conf, hyst, os;
+#ifdef CONFIG_SENSORS_ADT75_VARIANT
+		/* The ADT 75 cannot use many of the same detection schemes 
+		* as the LM75 because of its added registers and restricted 
+		* register addressing.  The user better 
+		*/
+		int conf;
+
+		/* Unused addresses */
+		conf = i2c_smbus_read_byte_data(new_client, LM75_REG_CONF);
+		if (conf & 0x40)
+			goto exit_free;
+#else
+		int cur, conf, hyst, os, i;
 
 		/* Unused addresses */
 		cur = i2c_smbus_read_word_data(new_client, 0);
@@ -175,8 +185,8 @@
 			 || i2c_smbus_read_word_data(new_client, i + 2) != hyst
 			 || i2c_smbus_read_word_data(new_client, i + 3) != os)
 				goto exit_free;
-	}
-
+#endif
+	}
 	/* Determine the chip type - only one kind supported! */
 	if (kind <= 0)
 		kind = lm75;

Modified: uClinux/trunk/uClinux-dist/linux-2.6.x/drivers/i2c/busses/Kconfig
URL: http://svn.digium.com/view/aadk/uClinux/trunk/uClinux-dist/linux-2.6.x/drivers/i2c/busses/Kconfig?view=diff&rev=146&r1=145&r2=146
==============================================================================
--- uClinux/trunk/uClinux-dist/linux-2.6.x/drivers/i2c/busses/Kconfig (original)
+++ uClinux/trunk/uClinux-dist/linux-2.6.x/drivers/i2c/busses/Kconfig Tue Feb  6 10:40:33 2007
@@ -55,7 +55,6 @@
 config TWI_HWMON
 	bool "Blackfin TWI HWMON Class association"
 	depends on I2C_BFIN_TWI
-	default 50
 	help
 		Associates the Blackfin TWI with the HWMON driver by setting the 
 		TWI class to I2C_CLASS_HWMON.  hwmon device require this class type in



More information about the aadk-commits mailing list