[PATCH linux dev-4.10 2/3] hwmon: pmbus: max31785: Mark virtual pages as virtual

Andrew Jeffery andrew at aj.id.au
Thu Oct 26 17:19:39 AEDT 2017


Avoid setting PAGE to a unsupported value on the MAX31785 to avoid
errors from the hardware in circumstances that we know it will fail.

The virtual pages are used to expose the non-standard tacho measurements
for the second rotor of a dual-rotor fan. Maxim's implementation breaks
with the PMBus standard by providing a four-byte response to what is
usually a two-byte command.

Cc: Eddie James <eajames at linux.vnet.ibm.com>
Cc: Matt Spinler <mspinler at linux.vnet.ibm.com>
Signed-off-by: Andrew Jeffery <andrew at aj.id.au>
---
 drivers/hwmon/pmbus/max31785.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/hwmon/pmbus/max31785.c b/drivers/hwmon/pmbus/max31785.c
index 6a0d289ad346..c862ab51e3af 100644
--- a/drivers/hwmon/pmbus/max31785.c
+++ b/drivers/hwmon/pmbus/max31785.c
@@ -436,6 +436,7 @@ static int max31785_of_fan_config(struct i2c_client *client,
 
 			info->pages = max(info->pages, virtual + 1);
 			info->func[virtual] |= PMBUS_HAVE_FAN12;
+			info->func[virtual] |= PMBUS_PAGE_VIRTUAL;
 		}
 	}
 
-- 
2.11.0



More information about the openbmc mailing list