@@ -182,7 +182,8 @@ enum chips { lm90, adm1032, lm99, lm86, max6657, max6659, adt7461, max6680,
182
182
#define LM90_HAVE_EMERGENCY_ALARM (1 << 5)/* emergency alarm */
183
183
#define LM90_HAVE_TEMP3 (1 << 6) /* 3rd temperature sensor */
184
184
#define LM90_HAVE_BROKEN_ALERT (1 << 7) /* Broken alert */
185
- #define LM90_PAUSE_FOR_CONFIG (1 << 8) /* Pause conversion for config */
185
+ #define LM90_HAVE_EXTENDED_TEMP (1 << 8) /* extended temperature support*/
186
+ #define LM90_PAUSE_FOR_CONFIG (1 << 9) /* Pause conversion for config */
186
187
187
188
/* LM90 status */
188
189
#define LM90_STATUS_LTHRM (1 << 0) /* local THERM limit tripped */
@@ -350,7 +351,7 @@ static const struct lm90_params lm90_params[] = {
350
351
},
351
352
[adt7461 ] = {
352
353
.flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT
353
- | LM90_HAVE_BROKEN_ALERT ,
354
+ | LM90_HAVE_BROKEN_ALERT | LM90_HAVE_EXTENDED_TEMP ,
354
355
.alert_alarms = 0x7c ,
355
356
.max_convrate = 10 ,
356
357
},
@@ -422,7 +423,7 @@ static const struct lm90_params lm90_params[] = {
422
423
},
423
424
[tmp451 ] = {
424
425
.flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT
425
- | LM90_HAVE_BROKEN_ALERT ,
426
+ | LM90_HAVE_BROKEN_ALERT | LM90_HAVE_EXTENDED_TEMP ,
426
427
.alert_alarms = 0x7c ,
427
428
.max_convrate = 9 ,
428
429
.reg_local_ext = TMP451_REG_R_LOCAL_TEMPL ,
@@ -998,7 +999,7 @@ static int lm90_get_temp11(struct lm90_data *data, int index)
998
999
s16 temp11 = data -> temp11 [index ];
999
1000
int temp ;
1000
1001
1001
- if (data -> kind == adt7461 || data -> kind == tmp451 )
1002
+ if (data -> flags & LM90_HAVE_EXTENDED_TEMP )
1002
1003
temp = temp_from_u16_adt7461 (data , temp11 );
1003
1004
else if (data -> kind == max6646 )
1004
1005
temp = temp_from_u16 (temp11 );
@@ -1035,7 +1036,7 @@ static int lm90_set_temp11(struct lm90_data *data, int index, long val)
1035
1036
val -= 16000 ;
1036
1037
}
1037
1038
1038
- if (data -> kind == adt7461 || data -> kind == tmp451 )
1039
+ if (data -> flags & LM90_HAVE_EXTENDED_TEMP )
1039
1040
data -> temp11 [index ] = temp_to_u16_adt7461 (data , val );
1040
1041
else if (data -> kind == max6646 )
1041
1042
data -> temp11 [index ] = temp_to_u8 (val ) << 8 ;
@@ -1062,7 +1063,7 @@ static int lm90_get_temp8(struct lm90_data *data, int index)
1062
1063
s8 temp8 = data -> temp8 [index ];
1063
1064
int temp ;
1064
1065
1065
- if (data -> kind == adt7461 || data -> kind == tmp451 )
1066
+ if (data -> flags & LM90_HAVE_EXTENDED_TEMP )
1066
1067
temp = temp_from_u8_adt7461 (data , temp8 );
1067
1068
else if (data -> kind == max6646 )
1068
1069
temp = temp_from_u8 (temp8 );
@@ -1098,7 +1099,7 @@ static int lm90_set_temp8(struct lm90_data *data, int index, long val)
1098
1099
val -= 16000 ;
1099
1100
}
1100
1101
1101
- if (data -> kind == adt7461 || data -> kind == tmp451 )
1102
+ if (data -> flags & LM90_HAVE_EXTENDED_TEMP )
1102
1103
data -> temp8 [index ] = temp_to_u8_adt7461 (data , val );
1103
1104
else if (data -> kind == max6646 )
1104
1105
data -> temp8 [index ] = temp_to_u8 (val );
@@ -1116,7 +1117,7 @@ static int lm90_get_temphyst(struct lm90_data *data, int index)
1116
1117
{
1117
1118
int temp ;
1118
1119
1119
- if (data -> kind == adt7461 || data -> kind == tmp451 )
1120
+ if (data -> flags & LM90_HAVE_EXTENDED_TEMP )
1120
1121
temp = temp_from_u8_adt7461 (data , data -> temp8 [index ]);
1121
1122
else if (data -> kind == max6646 )
1122
1123
temp = temp_from_u8 (data -> temp8 [index ]);
@@ -1136,7 +1137,7 @@ static int lm90_set_temphyst(struct lm90_data *data, long val)
1136
1137
int temp ;
1137
1138
int err ;
1138
1139
1139
- if (data -> kind == adt7461 || data -> kind == tmp451 )
1140
+ if (data -> flags & LM90_HAVE_EXTENDED_TEMP )
1140
1141
temp = temp_from_u8_adt7461 (data , data -> temp8 [LOCAL_CRIT ]);
1141
1142
else if (data -> kind == max6646 )
1142
1143
temp = temp_from_u8 (data -> temp8 [LOCAL_CRIT ]);
@@ -1685,7 +1686,7 @@ static int lm90_init_client(struct i2c_client *client, struct lm90_data *data)
1685
1686
lm90_set_convrate (client , data , 500 ); /* 500ms; 2Hz conversion rate */
1686
1687
1687
1688
/* Check Temperature Range Select */
1688
- if (data -> kind == adt7461 || data -> kind == tmp451 ) {
1689
+ if (data -> flags & LM90_HAVE_EXTENDED_TEMP ) {
1689
1690
if (config & 0x04 )
1690
1691
data -> flags |= LM90_FLAG_ADT7461_EXT ;
1691
1692
}
0 commit comments