3535 * explicitly as max6659, or if its address is not 0x4c.
3636 * These chips lack the remote temperature offset feature.
3737 *
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+ *
3846 * This driver also supports the MAX6646, MAX6647, MAX6648, MAX6649 and
3947 * MAX6692 chips made by Maxim. These are again similar to the LM86,
4048 * but they use unsigned temperature values and can report temperatures
94102 * have address 0x4d.
95103 * MAX6647 has address 0x4e.
96104 * 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.
99107 * SA56004 can have address 0x48 through 0x4F.
100108 */
101109
@@ -104,7 +112,7 @@ static const unsigned short normal_i2c[] = {
104112 0x4d , 0x4e , 0x4f , I2C_CLIENT_END };
105113
106114enum chips { lm90 , adm1032 , lm99 , lm86 , max6657 , max6659 , adt7461 , max6680 ,
107- max6646 , w83l771 , max6696 , sa56004 , g781 , tmp451 };
115+ max6646 , w83l771 , max6696 , sa56004 , g781 , tmp451 , max6654 };
108116
109117/*
110118 * The LM90 registers
@@ -145,7 +153,7 @@ enum chips { lm90, adm1032, lm99, lm86, max6657, max6659, adt7461, max6680,
145153#define LM90_REG_R_TCRIT_HYST 0x21
146154#define LM90_REG_W_TCRIT_HYST 0x21
147155
148- /* MAX6646/6647/6649/6657/6658/6659/6695/6696 registers */
156+ /* MAX6646/6647/6649/6654/ 6657/6658/6659/6695/6696 registers */
149157
150158#define MAX6657_REG_R_LOCAL_TEMPL 0x11
151159#define MAX6696_REG_R_STATUS2 0x12
@@ -209,6 +217,7 @@ static const struct i2c_device_id lm90_id[] = {
209217 { "max6646" , max6646 },
210218 { "max6647" , max6646 },
211219 { "max6649" , max6646 },
220+ { "max6654" , max6654 },
212221 { "max6657" , max6657 },
213222 { "max6658" , max6657 },
214223 { "max6659" , max6659 },
@@ -269,6 +278,10 @@ static const struct of_device_id __maybe_unused lm90_of_match[] = {
269278 .compatible = "dallas,max6649" ,
270279 .data = (void * )max6646
271280 },
281+ {
282+ .compatible = "dallas,max6654" ,
283+ .data = (void * )max6654
284+ },
272285 {
273286 .compatible = "dallas,max6657" ,
274287 .data = (void * )max6657
@@ -367,6 +380,11 @@ static const struct lm90_params lm90_params[] = {
367380 .max_convrate = 6 ,
368381 .reg_local_ext = MAX6657_REG_R_LOCAL_TEMPL ,
369382 },
383+ [max6654 ] = {
384+ .alert_alarms = 0x7c ,
385+ .max_convrate = 7 ,
386+ .reg_local_ext = MAX6657_REG_R_LOCAL_TEMPL ,
387+ },
370388 [max6657 ] = {
371389 .flags = LM90_PAUSE_FOR_CONFIG ,
372390 .alert_alarms = 0x7c ,
@@ -1557,6 +1575,16 @@ static int lm90_detect(struct i2c_client *client,
15571575 && (config1 & 0x3f ) == 0x00
15581576 && convrate <= 0x07 ) {
15591577 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" ;
15601588 }
15611589 } else
15621590 if (address == 0x4C
@@ -1660,6 +1688,15 @@ static int lm90_init_client(struct i2c_client *client, struct lm90_data *data)
16601688 if (data -> kind == max6680 )
16611689 config |= 0x18 ;
16621690
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+
16631700 /*
16641701 * Select external channel 0 for max6695/96
16651702 */
0 commit comments