hwmon: (pmbus) Add support for Intel VID protocol VR13
authorVadim Pasternak <vadimp@mellanox.com>
Tue, 29 Aug 2017 20:06:21 +0000 (20:06 +0000)
committerGuenter Roeck <linux@roeck-us.net>
Wed, 30 Aug 2017 13:31:00 +0000 (06:31 -0700)
The below lists of VOUT_MODE command readout with their related VID
protocols, Digital to Analog Converter steps:
- VR13.0 mode, 10-mV DAC - 0x24
- VR13.0 mode, 5-mV DAC - 0x27

Signed-off-by: Vadim Pasternak <vadimp@mellanox.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/pmbus/pmbus.h
drivers/hwmon/pmbus/pmbus_core.c

index bfcb13bae34bd67338e363d8b76849572d39f7d6..4efa2bd4f6d8aaa485367c0ff23d57a8d46678b3 100644 (file)
@@ -341,7 +341,7 @@ enum pmbus_sensor_classes {
 #define PMBUS_HAVE_STATUS_VMON BIT(19)
 
 enum pmbus_data_format { linear = 0, direct, vid };
-enum vrm_version { vr11 = 0, vr12 };
+enum vrm_version { vr11 = 0, vr12, vr13 };
 
 struct pmbus_driver_info {
        int pages;              /* Total number of pages */
index 6ac89c93bd2ee2d736e09280170985ca52c5cac2..302f0aef59dede142a4c9618b17de9db6768a168 100644 (file)
@@ -557,6 +557,10 @@ static long pmbus_reg2data_vid(struct pmbus_data *data,
                if (val >= 0x01)
                        rv = 250 + (val - 1) * 5;
                break;
+       case vr13:
+               if (val >= 0x01)
+                       rv = 500 + (val - 1) * 10;
+               break;
        }
        return rv;
 }