Skip to content

Commit

Permalink
hwmon: (w83795) Clear intrusion alarm immediately
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jean Delvare authored and Jean Delvare committed Nov 15, 2010
1 parent cf6b9ea commit 793c51d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/hwmon/w83795.c
Expand Up @@ -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;
}
Expand Down

0 comments on commit 793c51d

Please sign in to comment.