diff options
| -rw-r--r-- | drivers/hwmon/lm90.c | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c index 708bf0e7e4ac..7fef2a1194d9 100644 --- a/drivers/hwmon/lm90.c +++ b/drivers/hwmon/lm90.c | |||
| @@ -170,7 +170,6 @@ enum chips { lm90, adm1032, lm99, lm86, max6657, max6659, adt7461, max6680, | |||
| 170 | #define LM90_FLAG_ADT7461_EXT (1 << 0) /* ADT7461 extended mode */ | 170 | #define LM90_FLAG_ADT7461_EXT (1 << 0) /* ADT7461 extended mode */ |
| 171 | /* Device features */ | 171 | /* Device features */ |
| 172 | #define LM90_HAVE_OFFSET (1 << 1) /* temperature offset register */ | 172 | #define LM90_HAVE_OFFSET (1 << 1) /* temperature offset register */ |
| 173 | #define LM90_HAVE_LOCAL_EXT (1 << 2) /* extended local temperature */ | ||
| 174 | #define LM90_HAVE_REM_LIMIT_EXT (1 << 3) /* extended remote limit */ | 173 | #define LM90_HAVE_REM_LIMIT_EXT (1 << 3) /* extended remote limit */ |
| 175 | #define LM90_HAVE_EMERGENCY (1 << 4) /* 3rd upper (emergency) limit */ | 174 | #define LM90_HAVE_EMERGENCY (1 << 4) /* 3rd upper (emergency) limit */ |
| 176 | #define LM90_HAVE_EMERGENCY_ALARM (1 << 5)/* emergency alarm */ | 175 | #define LM90_HAVE_EMERGENCY_ALARM (1 << 5)/* emergency alarm */ |
| @@ -214,8 +213,7 @@ struct lm90_params { | |||
| 214 | u16 alert_alarms; /* Which alarm bits trigger ALERT# */ | 213 | u16 alert_alarms; /* Which alarm bits trigger ALERT# */ |
| 215 | /* Upper 8 bits for max6695/96 */ | 214 | /* Upper 8 bits for max6695/96 */ |
| 216 | u8 max_convrate; /* Maximum conversion rate register value */ | 215 | u8 max_convrate; /* Maximum conversion rate register value */ |
| 217 | u8 reg_local_ext; /* Local extension register if | 216 | u8 reg_local_ext; /* Extended local temp register (optional) */ |
| 218 | LM90_HAVE_LOCAL_EXT is set*/ | ||
| 219 | }; | 217 | }; |
| 220 | 218 | ||
| 221 | static const struct lm90_params lm90_params[] = { | 219 | static const struct lm90_params lm90_params[] = { |
| @@ -247,19 +245,17 @@ static const struct lm90_params lm90_params[] = { | |||
| 247 | .max_convrate = 9, | 245 | .max_convrate = 9, |
| 248 | }, | 246 | }, |
| 249 | [max6646] = { | 247 | [max6646] = { |
| 250 | .flags = LM90_HAVE_LOCAL_EXT, | ||
| 251 | .alert_alarms = 0x7c, | 248 | .alert_alarms = 0x7c, |
| 252 | .max_convrate = 6, | 249 | .max_convrate = 6, |
| 253 | .reg_local_ext = MAX6657_REG_R_LOCAL_TEMPL, | 250 | .reg_local_ext = MAX6657_REG_R_LOCAL_TEMPL, |
| 254 | }, | 251 | }, |
| 255 | [max6657] = { | 252 | [max6657] = { |
| 256 | .flags = LM90_HAVE_LOCAL_EXT, | ||
| 257 | .alert_alarms = 0x7c, | 253 | .alert_alarms = 0x7c, |
| 258 | .max_convrate = 8, | 254 | .max_convrate = 8, |
| 259 | .reg_local_ext = MAX6657_REG_R_LOCAL_TEMPL, | 255 | .reg_local_ext = MAX6657_REG_R_LOCAL_TEMPL, |
| 260 | }, | 256 | }, |
| 261 | [max6659] = { | 257 | [max6659] = { |
| 262 | .flags = LM90_HAVE_LOCAL_EXT | LM90_HAVE_EMERGENCY, | 258 | .flags = LM90_HAVE_EMERGENCY, |
| 263 | .alert_alarms = 0x7c, | 259 | .alert_alarms = 0x7c, |
| 264 | .max_convrate = 8, | 260 | .max_convrate = 8, |
| 265 | .reg_local_ext = MAX6657_REG_R_LOCAL_TEMPL, | 261 | .reg_local_ext = MAX6657_REG_R_LOCAL_TEMPL, |
| @@ -270,7 +266,7 @@ static const struct lm90_params lm90_params[] = { | |||
| 270 | .max_convrate = 7, | 266 | .max_convrate = 7, |
| 271 | }, | 267 | }, |
| 272 | [max6696] = { | 268 | [max6696] = { |
| 273 | .flags = LM90_HAVE_LOCAL_EXT | LM90_HAVE_EMERGENCY | 269 | .flags = LM90_HAVE_EMERGENCY |
| 274 | | LM90_HAVE_EMERGENCY_ALARM | LM90_HAVE_TEMP3, | 270 | | LM90_HAVE_EMERGENCY_ALARM | LM90_HAVE_TEMP3, |
| 275 | .alert_alarms = 0x187c, | 271 | .alert_alarms = 0x187c, |
| 276 | .max_convrate = 6, | 272 | .max_convrate = 6, |
| @@ -282,8 +278,7 @@ static const struct lm90_params lm90_params[] = { | |||
| 282 | .max_convrate = 8, | 278 | .max_convrate = 8, |
| 283 | }, | 279 | }, |
| 284 | [sa56004] = { | 280 | [sa56004] = { |
| 285 | .flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT | 281 | .flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT, |
| 286 | | LM90_HAVE_LOCAL_EXT, | ||
| 287 | .alert_alarms = 0x7b, | 282 | .alert_alarms = 0x7b, |
| 288 | .max_convrate = 9, | 283 | .max_convrate = 9, |
| 289 | .reg_local_ext = SA56004_REG_R_LOCAL_TEMPL, | 284 | .reg_local_ext = SA56004_REG_R_LOCAL_TEMPL, |
| @@ -476,7 +471,7 @@ static struct lm90_data *lm90_update_device(struct device *dev) | |||
| 476 | lm90_read_reg(client, LM90_REG_R_REMOTE_CRIT, &data->temp8[3]); | 471 | lm90_read_reg(client, LM90_REG_R_REMOTE_CRIT, &data->temp8[3]); |
| 477 | lm90_read_reg(client, LM90_REG_R_TCRIT_HYST, &data->temp_hyst); | 472 | lm90_read_reg(client, LM90_REG_R_TCRIT_HYST, &data->temp_hyst); |
| 478 | 473 | ||
| 479 | if (data->flags & LM90_HAVE_LOCAL_EXT) { | 474 | if (data->reg_local_ext) { |
| 480 | lm90_read16(client, LM90_REG_R_LOCAL_TEMP, | 475 | lm90_read16(client, LM90_REG_R_LOCAL_TEMP, |
| 481 | data->reg_local_ext, | 476 | data->reg_local_ext, |
| 482 | &data->temp11[4]); | 477 | &data->temp11[4]); |
| @@ -1397,15 +1392,11 @@ static int lm90_probe(struct i2c_client *new_client, | |||
| 1397 | 1392 | ||
| 1398 | /* Set chip capabilities */ | 1393 | /* Set chip capabilities */ |
| 1399 | data->flags = lm90_params[data->kind].flags; | 1394 | data->flags = lm90_params[data->kind].flags; |
| 1395 | data->reg_local_ext = lm90_params[data->kind].reg_local_ext; | ||
| 1400 | 1396 | ||
| 1401 | /* Set maximum conversion rate */ | 1397 | /* Set maximum conversion rate */ |
| 1402 | data->max_convrate = lm90_params[data->kind].max_convrate; | 1398 | data->max_convrate = lm90_params[data->kind].max_convrate; |
| 1403 | 1399 | ||
| 1404 | if (data->flags & LM90_HAVE_LOCAL_EXT) { | ||
| 1405 | data->reg_local_ext = lm90_params[data->kind].reg_local_ext; | ||
| 1406 | WARN_ON(data->reg_local_ext == 0); | ||
| 1407 | } | ||
| 1408 | |||
| 1409 | /* Initialize the LM90 chip */ | 1400 | /* Initialize the LM90 chip */ |
| 1410 | lm90_init_client(new_client); | 1401 | lm90_init_client(new_client); |
| 1411 | 1402 | ||
