Skip to content

Commit

Permalink
hwmon: (pmbus) Clear pmbus fault/warning bits after read
Browse files Browse the repository at this point in the history
Almost all fault/warning bits in pmbus status registers remain set even
after fault/warning condition are removed. As per pmbus specification
these faults must be cleared by user.
Modify hwmon behavior to clear fault/warning bit after fetching data if
fault/warning bit was set. This allows to get fresh data in next read.

Signed-off-by: Vikash Chandola <vikash.chandola@linux.intel.com>
Link: https://lore.kernel.org/r/20220222131253.2426834-1-vikash.chandola@linux.intel.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
  • Loading branch information
vikash-chandola authored and groeck committed Feb 22, 2022
1 parent 1b5f517 commit 35f165f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/hwmon/pmbus/pmbus_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -911,6 +911,11 @@ static int pmbus_get_boolean(struct i2c_client *client, struct pmbus_boolean *b,
pmbus_update_sensor_data(client, s2);

regval = status & mask;
if (regval) {
ret = pmbus_write_byte_data(client, page, reg, regval);
if (ret)
goto unlock;
}
if (s1 && s2) {
s64 v1, v2;

Expand Down

0 comments on commit 35f165f

Please sign in to comment.