Skip to content

Commit

Permalink
hwmon: (pmbus) Enable PEC if the controller supports it
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Guenter Roeck committed Aug 19, 2015
1 parent 2c052d4 commit d830e27
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 @@ -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) {
Expand Down

0 comments on commit d830e27

Please sign in to comment.