projects
/
GitHub
/
LineageOS
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2c052d4
)
hwmon: (pmbus) Enable PEC if the controller supports it
author
Guenter Roeck
<linux@roeck-us.net>
Mon, 17 Aug 2015 23:26:21 +0000
(16:26 -0700)
committer
Guenter Roeck
<linux@roeck-us.net>
Wed, 19 Aug 2015 16:08:29 +0000
(09:08 -0700)
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>
drivers/hwmon/pmbus/pmbus_core.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/hwmon/pmbus/pmbus_core.c
b/drivers/hwmon/pmbus/pmbus_core.c
index 398198140b8190040c5fc8f443fa400df09c2066..ba59eaef2e075a74cb15940fdc095673c15346a4 100644
(file)
--- 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) {