summaryrefslogtreecommitdiff
path: root/drivers/hwmon/lm90.c
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2010-10-28 22:31:44 +0400
committerJean Delvare <khali@endymion.delvare>2010-10-28 22:31:44 +0400
commitc4f99a2b8fb4c564865f0037a2b7be690d4409f3 (patch)
tree3b6b7f2261be322412f9dd9eb0df6e3fed7f552c /drivers/hwmon/lm90.c
parent0c01b644f77a3df892a48a59901997469aeab0a7 (diff)
downloadlinux-c4f99a2b8fb4c564865f0037a2b7be690d4409f3.tar.xz
hwmon: (lm90) Add support for the W83L771W/G
I was wondering if that chip ever existed publicly... Apparently yes, so add support for it. Signed-off-by: Jean Delvare <khali@linux-fr.org> Tested-by: Alexander Stein <alexander.stein@informatik.tu-chemnitz.de> Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
Diffstat (limited to 'drivers/hwmon/lm90.c')
-rw-r--r--drivers/hwmon/lm90.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c
index f9e76c757de8..812781c655a7 100644
--- a/drivers/hwmon/lm90.c
+++ b/drivers/hwmon/lm90.c
@@ -88,8 +88,8 @@
* Addresses to scan
* Address is fully defined internally and cannot be changed except for
* MAX6659, MAX6680 and MAX6681.
- * LM86, LM89, LM90, LM99, ADM1032, ADM1032-1, ADT7461, MAX6649, MAX6657
- * and MAX6658 have address 0x4c.
+ * LM86, LM89, LM90, LM99, ADM1032, ADM1032-1, ADT7461, MAX6649, MAX6657,
+ * MAX6658 and W83L771 have address 0x4c.
* ADM1032-2, ADT7461-2, LM89-1, LM99-1 and MAX6646 have address 0x4d.
* MAX6647 has address 0x4e.
* MAX6659 can have address 0x4c, 0x4d or 0x4e.
@@ -1237,10 +1237,23 @@ static int lm90_detect(struct i2c_client *new_client,
} else
if (address == 0x4C
&& man_id == 0x5C) { /* Winbond/Nuvoton */
- if ((chip_id & 0xFE) == 0x10 /* W83L771AWG/ASG */
- && (reg_config1 & 0x2A) == 0x00
- && reg_convrate <= 0x08) {
- name = "w83l771";
+ int reg_config2;
+
+ reg_config2 = i2c_smbus_read_byte_data(new_client,
+ LM90_REG_R_CONFIG2);
+ if (reg_config2 < 0)
+ return -ENODEV;
+
+ if ((reg_config1 & 0x2A) == 0x00
+ && (reg_config2 & 0xF8) == 0x00) {
+ if (chip_id == 0x01 /* W83L771W/G */
+ && reg_convrate <= 0x09) {
+ name = "w83l771";
+ } else
+ if ((chip_id & 0xFE) == 0x10 /* W83L771AWG/ASG */
+ && reg_convrate <= 0x08) {
+ name = "w83l771";
+ }
}
}