hwmon: (lm90) Add support for GMT G781
authorGuenter Roeck <linux@roeck-us.net>
Fri, 23 Mar 2012 09:02:18 +0000 (10:02 +0100)
committerJean Delvare <khali@endymion.delvare>
Fri, 23 Mar 2012 09:02:18 +0000 (10:02 +0100)
GMT G781 is a ADM1032-compatible temperature sensor chip.
Add support to the LM90 driver.

Cc: Mike Gorchak <lestat@i.com.ua>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Documentation/hwmon/lm90
drivers/hwmon/Kconfig
drivers/hwmon/lm90.c

index 9cd14cfe6515e34cdcceffc231b1996f141172b3..b466974e142fc3e288c993697455b24020ece1ce 100644 (file)
@@ -118,6 +118,10 @@ Supported chips:
     Addresses scanned: I2C 0x48 through 0x4F
     Datasheet: Publicly available at NXP website
                http://ics.nxp.com/products/interface/datasheet/sa56004x.pdf
+  * GMT G781
+    Prefix: 'g781'
+    Addresses scanned: I2C 0x4c, 0x4d
+    Datasheet: Not publicly available from GMT
 
 Author: Jean Delvare <khali@linux-fr.org>
 
index 783a3144ffd7ffa410350aba19f1138998b2c730..fc3f4e1cad2c6db11d12641663607fc00c165b79 100644 (file)
@@ -648,7 +648,8 @@ config SENSORS_LM90
          LM86, LM89 and LM99, Analog Devices ADM1032, ADT7461, and ADT7461A,
          Maxim MAX6646, MAX6647, MAX6648, MAX6649, MAX6657, MAX6658, MAX6659,
          MAX6680, MAX6681, MAX6692, MAX6695, MAX6696, ON Semiconductor NCT1008,
-         Winbond/Nuvoton W83L771W/G/AWG/ASG and Philips SA56004 sensor chips.
+         Winbond/Nuvoton W83L771W/G/AWG/ASG, Philips SA56004, and GMT G781
+         sensor chips.
 
          This driver can also be built as a module.  If so, the module
          will be called lm90.
index 22efae34c2f62d40a0c93a3279337da0848b68be..3309a511e8e1ebc09784141a5e38796ac3620d8d 100644 (file)
@@ -57,6 +57,9 @@
  * This driver also supports the SA56004 from Philips. This device is
  * pin-compatible with the LM86, the ED/EDP parts are also address-compatible.
  *
+ * This driver also supports the G781 from GMT. This device is compatible
+ * with the ADM1032.
+ *
  * Since the LM90 was the first chipset supported by this driver, most
  * comments will refer to this chipset, but are actually general and
  * concern all supported chipsets, unless mentioned otherwise.
@@ -107,7 +110,7 @@ static const unsigned short normal_i2c[] = {
        0x4d, 0x4e, 0x4f, I2C_CLIENT_END };
 
 enum chips { lm90, adm1032, lm99, lm86, max6657, max6659, adt7461, max6680,
-       max6646, w83l771, max6696, sa56004 };
+       max6646, w83l771, max6696, sa56004, g781 };
 
 /*
  * The LM90 registers
@@ -184,6 +187,7 @@ static const struct i2c_device_id lm90_id[] = {
        { "adm1032", adm1032 },
        { "adt7461", adt7461 },
        { "adt7461a", adt7461 },
+       { "g781", g781 },
        { "lm90", lm90 },
        { "lm86", lm86 },
        { "lm89", lm86 },
@@ -229,6 +233,12 @@ static const struct lm90_params lm90_params[] = {
                .alert_alarms = 0x7c,
                .max_convrate = 10,
        },
+       [g781] = {
+               .flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT
+                 | LM90_HAVE_BROKEN_ALERT,
+               .alert_alarms = 0x7c,
+               .max_convrate = 8,
+       },
        [lm86] = {
                .flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT,
                .alert_alarms = 0x7b,
@@ -1289,6 +1299,13 @@ static int lm90_detect(struct i2c_client *client,
                 && convrate <= 0x09) {
                        name = "sa56004";
                }
+       } else
+       if ((address == 0x4C || address == 0x4D)
+        && man_id == 0x47) { /* GMT */
+               if (chip_id == 0x01 /* G781 */
+                && (config1 & 0x3F) == 0x00
+                && convrate <= 0x08)
+                       name = "g781";
        }
 
        if (!name) { /* identification failed */