35
35
* explicitly as max6659, or if its address is not 0x4c.
36
36
* These chips lack the remote temperature offset feature.
37
37
*
38
+ * This driver also supports the MAX6654 chip made by Maxim. This chip can
39
+ * be at 9 different addresses, similar to MAX6680/MAX6681. The MAX6654 is
40
+ * otherwise similar to MAX6657/MAX6658/MAX6659. Extended range is available
41
+ * by setting the configuration register accordingly, and is done during
42
+ * initialization. Extended precision is only available at conversion rates
43
+ * of 1 Hz and slower. Note that extended precision is not enabled by
44
+ * default, as this driver initializes all chips to 2 Hz by design.
45
+ *
38
46
* This driver also supports the MAX6646, MAX6647, MAX6648, MAX6649 and
39
47
* MAX6692 chips made by Maxim. These are again similar to the LM86,
40
48
* but they use unsigned temperature values and can report temperatures
94
102
* have address 0x4d.
95
103
* MAX6647 has address 0x4e.
96
104
* MAX6659 can have address 0x4c, 0x4d or 0x4e.
97
- * MAX6680 and MAX6681 can have address 0x18, 0x19, 0x1a, 0x29, 0x2a, 0x2b ,
98
- * 0x4c, 0x4d or 0x4e.
105
+ * MAX6654, MAX6680, and MAX6681 can have address 0x18, 0x19, 0x1a, 0x29,
106
+ * 0x2a, 0x2b, 0x4c, 0x4d or 0x4e.
99
107
* SA56004 can have address 0x48 through 0x4F.
100
108
*/
101
109
@@ -104,7 +112,7 @@ static const unsigned short normal_i2c[] = {
104
112
0x4d , 0x4e , 0x4f , I2C_CLIENT_END };
105
113
106
114
enum chips { lm90 , adm1032 , lm99 , lm86 , max6657 , max6659 , adt7461 , max6680 ,
107
- max6646 , w83l771 , max6696 , sa56004 , g781 , tmp451 };
115
+ max6646 , w83l771 , max6696 , sa56004 , g781 , tmp451 , max6654 };
108
116
109
117
/*
110
118
* The LM90 registers
@@ -145,7 +153,7 @@ enum chips { lm90, adm1032, lm99, lm86, max6657, max6659, adt7461, max6680,
145
153
#define LM90_REG_R_TCRIT_HYST 0x21
146
154
#define LM90_REG_W_TCRIT_HYST 0x21
147
155
148
- /* MAX6646/6647/6649/6657/6658/6659/6695/6696 registers */
156
+ /* MAX6646/6647/6649/6654/ 6657/6658/6659/6695/6696 registers */
149
157
150
158
#define MAX6657_REG_R_LOCAL_TEMPL 0x11
151
159
#define MAX6696_REG_R_STATUS2 0x12
@@ -209,6 +217,7 @@ static const struct i2c_device_id lm90_id[] = {
209
217
{ "max6646" , max6646 },
210
218
{ "max6647" , max6646 },
211
219
{ "max6649" , max6646 },
220
+ { "max6654" , max6654 },
212
221
{ "max6657" , max6657 },
213
222
{ "max6658" , max6657 },
214
223
{ "max6659" , max6659 },
@@ -269,6 +278,10 @@ static const struct of_device_id __maybe_unused lm90_of_match[] = {
269
278
.compatible = "dallas,max6649" ,
270
279
.data = (void * )max6646
271
280
},
281
+ {
282
+ .compatible = "dallas,max6654" ,
283
+ .data = (void * )max6654
284
+ },
272
285
{
273
286
.compatible = "dallas,max6657" ,
274
287
.data = (void * )max6657
@@ -367,6 +380,11 @@ static const struct lm90_params lm90_params[] = {
367
380
.max_convrate = 6 ,
368
381
.reg_local_ext = MAX6657_REG_R_LOCAL_TEMPL ,
369
382
},
383
+ [max6654 ] = {
384
+ .alert_alarms = 0x7c ,
385
+ .max_convrate = 7 ,
386
+ .reg_local_ext = MAX6657_REG_R_LOCAL_TEMPL ,
387
+ },
370
388
[max6657 ] = {
371
389
.flags = LM90_PAUSE_FOR_CONFIG ,
372
390
.alert_alarms = 0x7c ,
@@ -1557,6 +1575,16 @@ static int lm90_detect(struct i2c_client *client,
1557
1575
&& (config1 & 0x3f ) == 0x00
1558
1576
&& convrate <= 0x07 ) {
1559
1577
name = "max6646" ;
1578
+ } else
1579
+ /*
1580
+ * The chip_id of the MAX6654 holds the revision of the chip.
1581
+ * The lowest 3 bits of the config1 register are unused and
1582
+ * should return zero when read.
1583
+ */
1584
+ if (chip_id == 0x08
1585
+ && (config1 & 0x07 ) == 0x00
1586
+ && convrate <= 0x07 ) {
1587
+ name = "max6654" ;
1560
1588
}
1561
1589
} else
1562
1590
if (address == 0x4C
@@ -1660,6 +1688,15 @@ static int lm90_init_client(struct i2c_client *client, struct lm90_data *data)
1660
1688
if (data -> kind == max6680 )
1661
1689
config |= 0x18 ;
1662
1690
1691
+ /*
1692
+ * Put MAX6654 into extended range (0x20, extend minimum range from
1693
+ * 0 degrees to -64 degrees). Note that extended resolution is not
1694
+ * possible on the MAX6654 unless conversion rate is set to 1 Hz or
1695
+ * slower, which is intentionally not done by default.
1696
+ */
1697
+ if (data -> kind == max6654 )
1698
+ config |= 0x20 ;
1699
+
1663
1700
/*
1664
1701
* Select external channel 0 for max6695/96
1665
1702
*/
0 commit comments