diff options
author | Guenter Roeck <linux@roeck-us.net> | 2015-08-18 01:26:21 +0200 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2015-08-19 18:08:29 +0200 |
commit | d830e27dac26b4f084c5ed2282666527f90db0ed (patch) | |
tree | b27b123577dcef97da43c4c047183172792ea37c /drivers/hwmon | |
parent | hwmon: (pmbus) Use BIT macro (diff) | |
download | linux-d830e27dac26b4f084c5ed2282666527f90db0ed.tar.xz linux-d830e27dac26b4f084c5ed2282666527f90db0ed.zip |
hwmon: (pmbus) Enable PEC if the controller supports it
PMBus controllers optionally support PEC. Configure the driver
to use it if available to improve operational security.
Suggested-by: Michael Jones <mike@proclivis.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r-- | drivers/hwmon/pmbus/pmbus_core.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c index 398198140b81..ba59eaef2e07 100644 --- a/drivers/hwmon/pmbus/pmbus_core.c +++ b/drivers/hwmon/pmbus/pmbus_core.c @@ -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) { |