aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/lm90.c
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2013-11-15 04:40:38 -0500
committerJean Delvare <khali@endymion.delvare>2013-11-15 04:40:38 -0500
commite41fae2b1ed8c78283d73651cd65be0228c0dd1c (patch)
tree6e4579e3a7ea8baca3af19975bc72a983afe2466 /drivers/hwmon/lm90.c
parent5e01dc7b26d9f24f39abace5da98ccbd6a5ceb52 (diff)
hwmon: (lm90) Fix max6696 alarm handling
Bit 2 of status register 2 on MAX6696 (external diode 2 open) sets ALERT; the bit thus has to be listed in alert_alarms. Also display a message in the alert handler if the condition is encountered. Even though not all overtemperature conditions cause ALERT to be set, we should not ignore them in the alert handler. Display messages for all out-of-range conditions. Reported-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Cc: stable@vger.kernel.org Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers/hwmon/lm90.c')
-rw-r--r--drivers/hwmon/lm90.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c
index cdff74282955..14e36c114d61 100644
--- a/drivers/hwmon/lm90.c
+++ b/drivers/hwmon/lm90.c
@@ -278,7 +278,7 @@ static const struct lm90_params lm90_params[] = {
278 [max6696] = { 278 [max6696] = {
279 .flags = LM90_HAVE_EMERGENCY 279 .flags = LM90_HAVE_EMERGENCY
280 | LM90_HAVE_EMERGENCY_ALARM | LM90_HAVE_TEMP3, 280 | LM90_HAVE_EMERGENCY_ALARM | LM90_HAVE_TEMP3,
281 .alert_alarms = 0x187c, 281 .alert_alarms = 0x1c7c,
282 .max_convrate = 6, 282 .max_convrate = 6,
283 .reg_local_ext = MAX6657_REG_R_LOCAL_TEMPL, 283 .reg_local_ext = MAX6657_REG_R_LOCAL_TEMPL,
284 }, 284 },
@@ -1500,19 +1500,22 @@ static void lm90_alert(struct i2c_client *client, unsigned int flag)
1500 if ((alarms & 0x7f) == 0 && (alarms2 & 0xfe) == 0) { 1500 if ((alarms & 0x7f) == 0 && (alarms2 & 0xfe) == 0) {
1501 dev_info(&client->dev, "Everything OK\n"); 1501 dev_info(&client->dev, "Everything OK\n");
1502 } else { 1502 } else {
1503 if (alarms & 0x61) 1503 if ((alarms & 0x61) || (alarms2 & 0x80))
1504 dev_warn(&client->dev, 1504 dev_warn(&client->dev,
1505 "temp%d out of range, please check!\n", 1); 1505 "temp%d out of range, please check!\n", 1);
1506 if (alarms & 0x1a) 1506 if ((alarms & 0x1a) || (alarms2 & 0x20))
1507 dev_warn(&client->dev, 1507 dev_warn(&client->dev,
1508 "temp%d out of range, please check!\n", 2); 1508 "temp%d out of range, please check!\n", 2);
1509 if (alarms & 0x04) 1509 if (alarms & 0x04)
1510 dev_warn(&client->dev, 1510 dev_warn(&client->dev,
1511 "temp%d diode open, please check!\n", 2); 1511 "temp%d diode open, please check!\n", 2);
1512 1512
1513 if (alarms2 & 0x18) 1513 if (alarms2 & 0x5a)
1514 dev_warn(&client->dev, 1514 dev_warn(&client->dev,
1515 "temp%d out of range, please check!\n", 3); 1515 "temp%d out of range, please check!\n", 3);
1516 if (alarms2 & 0x04)
1517 dev_warn(&client->dev,
1518 "temp%d diode open, please check!\n", 3);
1516 1519
1517 /* 1520 /*
1518 * Disable ALERT# output, because these chips don't implement 1521 * Disable ALERT# output, because these chips don't implement