aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/w83795.c
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2010-11-15 15:38:57 -0500
committerJean Delvare <khali@endymion.delvare>2010-11-15 15:38:57 -0500
commit793c51d5fdfa76043f1221fdaa022f50146e8386 (patch)
tree7e6bc3676e24fa1ccadf5b4621f868f7ecff2940 /drivers/hwmon/w83795.c
parentcf6b9ea661ef4f20b4a4cba1a232a732339aae2c (diff)
hwmon: (w83795) Clear intrusion alarm immediately
When asked to clear the intrusion alarm, do so immediately. We have to invalidate the cache to make sure the new status will be read. But we also have to read from the status register once to clear the pending alarm, as writing to CLR_CHS surprising won't clear it automatically. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
Diffstat (limited to 'drivers/hwmon/w83795.c')
-rw-r--r--drivers/hwmon/w83795.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/hwmon/w83795.c b/drivers/hwmon/w83795.c
index 600b2adbbd49..90f4ffb357b7 100644
--- a/drivers/hwmon/w83795.c
+++ b/drivers/hwmon/w83795.c
@@ -755,6 +755,10 @@ store_chassis_clear(struct device *dev,
755 val = w83795_read(client, W83795_REG_CLR_CHASSIS); 755 val = w83795_read(client, W83795_REG_CLR_CHASSIS);
756 val |= 0x80; 756 val |= 0x80;
757 w83795_write(client, W83795_REG_CLR_CHASSIS, val); 757 w83795_write(client, W83795_REG_CLR_CHASSIS, val);
758
759 /* Clear status and force cache refresh */
760 w83795_read(client, W83795_REG_ALARM(5));
761 data->valid = 0;
758 mutex_unlock(&data->update_lock); 762 mutex_unlock(&data->update_lock);
759 return count; 763 return count;
760} 764}