From: Jean Delvare Date: Mon, 15 Nov 2010 20:38:57 +0000 (+0100) Subject: hwmon: (w83795) Clear intrusion alarm immediately X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=793c51d5fdfa76043f1221fdaa022f50146e8386;p=linux-beck.git 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 Acked-by: Guenter Roeck --- 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, val = w83795_read(client, W83795_REG_CLR_CHASSIS); val |= 0x80; w83795_write(client, W83795_REG_CLR_CHASSIS, val); + + /* Clear status and force cache refresh */ + w83795_read(client, W83795_REG_ALARM(5)); + data->valid = 0; mutex_unlock(&data->update_lock); return count; }