Commit 02c3c4e7 authored by Guenter Roeck's avatar Guenter Roeck

hwmon: (max1619) Mask valid alarm bits

Bit 0, 5, and 6 in the status register are reserved and, if set, do not
indicate an alarm. Bit 7 is the 'busy' bit and also does not indicate
an alarm. Mask the non-alarm bits to avoid reporting them to userspace.

Cc: Tzung-Bi Shih <tzungbi@kernel.org>
Reviewed-by: default avatarTzung-Bi Shih <tzungbi@kernel.org>
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
parent 216147e6
......@@ -112,6 +112,7 @@ static struct max1619_data *max1619_update_device(struct device *dev)
config = i2c_smbus_read_byte_data(client, MAX1619_REG_R_CONFIG);
if (!(config & 0x20))
data->alarms ^= 0x02;
data->alarms &= 0x1e;
data->last_updated = jiffies;
data->valid = true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment