[PATCH linux dev-4.10 5/6] max31785: Support mark-fan-installed devicetree property
Andrew Jeffery
andrew at aj.id.au
Sat Jul 29 02:22:48 AEST 2017
Allows fans to be marked as installed via the devicetree.
Signed-off-by: Andrew Jeffery <andrew at aj.id.au>
---
drivers/hwmon/pmbus/max31785.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/hwmon/pmbus/max31785.c b/drivers/hwmon/pmbus/max31785.c
index 1c2648ce5322..a86919bc7294 100644
--- a/drivers/hwmon/pmbus/max31785.c
+++ b/drivers/hwmon/pmbus/max31785.c
@@ -270,9 +270,14 @@ static int max31785_of_fan_config(struct i2c_client *client,
if (pb_cfg < 0)
return pb_cfg;
- if (!(pb_cfg & PB_FAN_1_INSTALLED)) {
- dev_warn(dev, "Fan %d is configured but not installed\n", page);
- return 0;
+ if (of_property_read_bool(child, "mark-fan-installed")) {
+ pb_cfg |= PB_FAN_1_INSTALLED;
+ } else {
+ if (!(pb_cfg & PB_FAN_1_INSTALLED)) {
+ dev_warn(dev, "Fan %d is configured but not installed\n",
+ page);
+ return 0;
+ }
}
ret = of_property_read_string(child, "maxim,fan-rotor-input", &sval);
--
2.11.0
More information about the openbmc
mailing list