Skip to content

Commit 598f412

Browse files
groeckgregkh
authored andcommitted
hwmon: (lm90) Fix max6696 alarm handling
commit e41fae2 upstream. 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> Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 9cce2a8 commit 598f412

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

‎drivers/hwmon/lm90.c‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ static const struct lm90_params lm90_params[] = {
278278
[max6696] = {
279279
.flags = LM90_HAVE_EMERGENCY
280280
| LM90_HAVE_EMERGENCY_ALARM | LM90_HAVE_TEMP3,
281-
.alert_alarms = 0x187c,
281+
.alert_alarms = 0x1c7c,
282282
.max_convrate = 6,
283283
.reg_local_ext = MAX6657_REG_R_LOCAL_TEMPL,
284284
},
@@ -1500,19 +1500,22 @@ static void lm90_alert(struct i2c_client *client, unsigned int flag)
15001500
if ((alarms & 0x7f) == 0 && (alarms2 & 0xfe) == 0) {
15011501
dev_info(&client->dev, "Everything OK\n");
15021502
} else {
1503-
if (alarms & 0x61)
1503+
if ((alarms & 0x61) || (alarms2 & 0x80))
15041504
dev_warn(&client->dev,
15051505
"temp%d out of range, please check!\n", 1);
1506-
if (alarms & 0x1a)
1506+
if ((alarms & 0x1a) || (alarms2 & 0x20))
15071507
dev_warn(&client->dev,
15081508
"temp%d out of range, please check!\n", 2);
15091509
if (alarms & 0x04)
15101510
dev_warn(&client->dev,
15111511
"temp%d diode open, please check!\n", 2);
15121512

1513-
if (alarms2 & 0x18)
1513+
if (alarms2 & 0x5a)
15141514
dev_warn(&client->dev,
15151515
"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);
15161519

15171520
/*
15181521
* Disable ALERT# output, because these chips don't implement

0 commit comments

Comments
 (0)