Skip to contentSkip to conversation

hwmon: (pmbus) Enable PEC if the controller supports it

PATCH New Guenter Roeck 1 participant 1 message Aug 19, 2015 Hardware monitoring

lore
Share & tools
lore

Guenter Roeck

author maintainer
#0 lore raw

PATCH 2/4 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.

---
 drivers/hwmon/pmbus/pmbus_core.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/hwmon/pmbus/pmbus_core.c +5 -0
index 398198140b81..ba59eaef2e07 100644
@@ -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) {
Signature · 7 lines
2.1.4


_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors