summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/pmbus/pmbus.c
diff options
context:
space:
mode:
authorDmitry Bazhenov2018-10-15 11:21:22 +0200
committerGuenter Roeck2018-10-15 21:44:36 +0200
commite7c6a55606b5c46b449d76588968b4d8caae903f (patch)
tree4039c1eafe2d0d3e9512d931d34ebb9390dd8f1a /drivers/hwmon/pmbus/pmbus.c
parenthwmon: (pmbus) remove redundant 'default n' from Kconfig (diff)
downloadkernel-qcow2-linux-e7c6a55606b5c46b449d76588968b4d8caae903f.tar.gz
kernel-qcow2-linux-e7c6a55606b5c46b449d76588968b4d8caae903f.tar.xz
kernel-qcow2-linux-e7c6a55606b5c46b449d76588968b4d8caae903f.zip
hwmon: (pmbus) Fix page count auto-detection.
Devices with compatible="pmbus" field have zero initial page count, and pmbus_clear_faults() being called before the page count auto- detection does not actually clear faults because it depends on the page count. Non-cleared faults in its turn may fail the subsequent page count auto-detection. This patch fixes this problem by calling pmbus_clear_fault_page() for currently set page and calling pmbus_clear_faults() after the page count was detected. Cc: stable@vger.kernel.org Signed-off-by: Dmitry Bazhenov <bazhenov.dn@gmail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/pmbus/pmbus.c')
-rw-r--r--drivers/hwmon/pmbus/pmbus.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/hwmon/pmbus/pmbus.c b/drivers/hwmon/pmbus/pmbus.c
index 7718e58dbda5..7688dab32f6e 100644
--- a/drivers/hwmon/pmbus/pmbus.c
+++ b/drivers/hwmon/pmbus/pmbus.c
@@ -118,6 +118,8 @@ static int pmbus_identify(struct i2c_client *client,
} else {
info->pages = 1;
}
+
+ pmbus_clear_faults(client);
}
if (pmbus_check_byte_register(client, 0, PMBUS_VOUT_MODE)) {