]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - drivers/hwmon/pmbus/pmbus_core.c
hwmon: (pmbus) Enable PEC if the controller supports it
[mirror_ubuntu-zesty-kernel.git] / drivers / hwmon / pmbus / pmbus_core.c
index 398198140b8190040c5fc8f443fa400df09c2066..ba59eaef2e075a74cb15940fdc095673c15346a4 100644 (file)
@@ -1751,6 +1751,11 @@ static int pmbus_init_common(struct i2c_client *client, struct pmbus_data *data,
                }
        }
 
+       /* Enable PEC if the controller supports it */
+       ret = i2c_smbus_read_byte_data(client, PMBUS_CAPABILITY);
+       if (ret >= 0 && (ret & PB_CAPABILITY_ERROR_CHECK))
+               client->flags |= I2C_CLIENT_PEC;
+
        pmbus_clear_faults(client);
 
        if (info->identify) {