提交 d830e27d 编写于 作者: G Guenter Roeck

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: NMichael Jones <mike@proclivis.com>
Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
上级 2c052d42
...@@ -1751,6 +1751,11 @@ static int pmbus_init_common(struct i2c_client *client, struct pmbus_data *data, ...@@ -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); pmbus_clear_faults(client);
if (info->identify) { if (info->identify) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册