提交 e41fae2b 编写于 作者: G Guenter Roeck 提交者: Jean Delvare

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: NJean Delvare <khali@linux-fr.org>
Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
Cc: stable@vger.kernel.org
Signed-off-by: NJean Delvare <khali@linux-fr.org>
上级 5e01dc7b
...@@ -278,7 +278,7 @@ static const struct lm90_params lm90_params[] = { ...@@ -278,7 +278,7 @@ static const struct lm90_params lm90_params[] = {
[max6696] = { [max6696] = {
.flags = LM90_HAVE_EMERGENCY .flags = LM90_HAVE_EMERGENCY
| LM90_HAVE_EMERGENCY_ALARM | LM90_HAVE_TEMP3, | LM90_HAVE_EMERGENCY_ALARM | LM90_HAVE_TEMP3,
.alert_alarms = 0x187c, .alert_alarms = 0x1c7c,
.max_convrate = 6, .max_convrate = 6,
.reg_local_ext = MAX6657_REG_R_LOCAL_TEMPL, .reg_local_ext = MAX6657_REG_R_LOCAL_TEMPL,
}, },
...@@ -1500,19 +1500,22 @@ static void lm90_alert(struct i2c_client *client, unsigned int flag) ...@@ -1500,19 +1500,22 @@ static void lm90_alert(struct i2c_client *client, unsigned int flag)
if ((alarms & 0x7f) == 0 && (alarms2 & 0xfe) == 0) { if ((alarms & 0x7f) == 0 && (alarms2 & 0xfe) == 0) {
dev_info(&client->dev, "Everything OK\n"); dev_info(&client->dev, "Everything OK\n");
} else { } else {
if (alarms & 0x61) if ((alarms & 0x61) || (alarms2 & 0x80))
dev_warn(&client->dev, dev_warn(&client->dev,
"temp%d out of range, please check!\n", 1); "temp%d out of range, please check!\n", 1);
if (alarms & 0x1a) if ((alarms & 0x1a) || (alarms2 & 0x20))
dev_warn(&client->dev, dev_warn(&client->dev,
"temp%d out of range, please check!\n", 2); "temp%d out of range, please check!\n", 2);
if (alarms & 0x04) if (alarms & 0x04)
dev_warn(&client->dev, dev_warn(&client->dev,
"temp%d diode open, please check!\n", 2); "temp%d diode open, please check!\n", 2);
if (alarms2 & 0x18) if (alarms2 & 0x5a)
dev_warn(&client->dev, dev_warn(&client->dev,
"temp%d out of range, please check!\n", 3); "temp%d out of range, please check!\n", 3);
if (alarms2 & 0x04)
dev_warn(&client->dev,
"temp%d diode open, please check!\n", 3);
/* /*
* Disable ALERT# output, because these chips don't implement * Disable ALERT# output, because these chips don't implement
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册