aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/lm90.c
diff options
context:
space:
mode:
authorGuenter Roeck <guenter.roeck@ericsson.com>2010-10-28 14:31:43 -0400
committerJean Delvare <khali@endymion.delvare>2010-10-28 14:31:43 -0400
commit13c84951a3d75ba820adf47eb2a3b1c5ab1fa635 (patch)
treebb9eeb881f6e170ec97d744059732433d667e2f4 /drivers/hwmon/lm90.c
parent96512861c3733609ac3d558602574674fa95ebf4 (diff)
hwmon: (lm90) Add explicit support for max6659
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers/hwmon/lm90.c')
-rw-r--r--drivers/hwmon/lm90.c32
1 files changed, 21 insertions, 11 deletions
diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c
index e7ef9657ae17..68ee8f78843e 100644
--- a/drivers/hwmon/lm90.c
+++ b/drivers/hwmon/lm90.c
@@ -85,7 +85,7 @@
85 * and MAX6658 have address 0x4c. 85 * and MAX6658 have address 0x4c.
86 * ADM1032-2, ADT7461-2, LM89-1, LM99-1 and MAX6646 have address 0x4d. 86 * ADM1032-2, ADT7461-2, LM89-1, LM99-1 and MAX6646 have address 0x4d.
87 * MAX6647 has address 0x4e. 87 * MAX6647 has address 0x4e.
88 * MAX6659 can have address 0x4c, 0x4d or 0x4e (unsupported). 88 * MAX6659 can have address 0x4c, 0x4d or 0x4e.
89 * MAX6680 and MAX6681 can have address 0x18, 0x19, 0x1a, 0x29, 0x2a, 0x2b, 89 * MAX6680 and MAX6681 can have address 0x18, 0x19, 0x1a, 0x29, 0x2a, 0x2b,
90 * 0x4c, 0x4d or 0x4e. 90 * 0x4c, 0x4d or 0x4e.
91 */ 91 */
@@ -93,8 +93,8 @@
93static const unsigned short normal_i2c[] = { 93static const unsigned short normal_i2c[] = {
94 0x18, 0x19, 0x1a, 0x29, 0x2a, 0x2b, 0x4c, 0x4d, 0x4e, I2C_CLIENT_END }; 94 0x18, 0x19, 0x1a, 0x29, 0x2a, 0x2b, 0x4c, 0x4d, 0x4e, I2C_CLIENT_END };
95 95
96enum chips { lm90, adm1032, lm99, lm86, max6657, adt7461, max6680, max6646, 96enum chips { lm90, adm1032, lm99, lm86, max6657, max6659, adt7461, max6680,
97 w83l771 }; 97 max6646, w83l771 };
98 98
99/* 99/*
100 * The LM90 registers 100 * The LM90 registers
@@ -176,7 +176,7 @@ static const struct i2c_device_id lm90_id[] = {
176 { "max6649", max6646 }, 176 { "max6649", max6646 },
177 { "max6657", max6657 }, 177 { "max6657", max6657 },
178 { "max6658", max6657 }, 178 { "max6658", max6657 },
179 { "max6659", max6657 }, 179 { "max6659", max6659 },
180 { "max6680", max6680 }, 180 { "max6680", max6680 },
181 { "max6681", max6680 }, 181 { "max6681", max6680 },
182 { "w83l771", w83l771 }, 182 { "w83l771", w83l771 },
@@ -220,7 +220,7 @@ struct lm90_data {
220 s16 temp11[5]; /* 0: remote input 220 s16 temp11[5]; /* 0: remote input
221 1: remote low limit 221 1: remote low limit
222 2: remote high limit 222 2: remote high limit
223 3: remote offset (except max6646 and max6657) 223 3: remote offset (except max6646 and max6657/58/59)
224 4: local input */ 224 4: local input */
225 u8 temp_hyst; 225 u8 temp_hyst;
226 u8 alarms; /* bitvector */ 226 u8 alarms; /* bitvector */
@@ -766,12 +766,20 @@ static int lm90_detect(struct i2c_client *new_client,
766 * register. Likewise, the config1 register seems to lack a 766 * register. Likewise, the config1 register seems to lack a
767 * low nibble, so the value will be those of the previous 767 * low nibble, so the value will be those of the previous
768 * read, so in our case those of the man_id register. 768 * read, so in our case those of the man_id register.
769 * MAX6659 has a third set of upper temperature limit registers.
770 * Those registers also return values on MAX6657 and MAX6658,
771 * thus the only way to detect MAX6659 is by its address.
772 * For this reason it will be mis-detected as MAX6657 if its
773 * address is 0x4C.
769 */ 774 */
770 if (chip_id == man_id 775 if (chip_id == man_id
771 && (address == 0x4C || address == 0x4D) 776 && (address == 0x4C || address == 0x4D || address == 0x4E)
772 && (reg_config1 & 0x1F) == (man_id & 0x0F) 777 && (reg_config1 & 0x1F) == (man_id & 0x0F)
773 && reg_convrate <= 0x09) { 778 && reg_convrate <= 0x09) {
774 name = "max6657"; 779 if (address == 0x4C)
780 name = "max6657";
781 else
782 name = "max6659";
775 } else 783 } else
776 /* 784 /*
777 * The chip_id register of the MAX6680 and MAX6681 holds the 785 * The chip_id register of the MAX6680 and MAX6681 holds the
@@ -861,14 +869,16 @@ static int lm90_probe(struct i2c_client *new_client,
861 } 869 }
862 870
863 /* Set chip capabilities */ 871 /* Set chip capabilities */
864 if (data->kind != max6657 && data->kind != max6646) 872 if (data->kind != max6657 && data->kind != max6659
873 && data->kind != max6646)
865 data->flags |= LM90_HAVE_OFFSET; 874 data->flags |= LM90_HAVE_OFFSET;
866 875
867 if (data->kind == max6657 || data->kind == max6646) 876 if (data->kind == max6657 || data->kind == max6659
877 || data->kind == max6646)
868 data->flags |= LM90_HAVE_LOCAL_EXT; 878 data->flags |= LM90_HAVE_LOCAL_EXT;
869 879
870 if (data->kind != max6657 && data->kind != max6646 880 if (data->kind != max6657 && data->kind != max6659
871 && data->kind != max6680) 881 && data->kind != max6646 && data->kind != max6680)
872 data->flags |= LM90_HAVE_REM_LIMIT_EXT; 882 data->flags |= LM90_HAVE_REM_LIMIT_EXT;
873 883
874 /* Initialize the LM90 chip */ 884 /* Initialize the LM90 chip */