]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
hwmon: (pmbus/core) Add support for NVIDIA nvidia195mv mode
authorAshish Yadav <ashish.yadav@infineon.com>
Mon, 23 Feb 2026 05:08:03 +0000 (10:38 +0530)
committerGuenter Roeck <linux@roeck-us.net>
Tue, 31 Mar 2026 02:45:05 +0000 (19:45 -0700)
Extend the PMBus core vrm_version handling to support NVIDIA nvidia195mv
VID mode. This adds a new VRM/VID encoding type and the corresponding
voltage conversion logic so devices reporting nvidia195mv can have their
VOUT/VID values interpreted correctly by the hwmon PMBus core.

Signed-off-by: Ashish Yadav <ashish.yadav@infineon.com>
Link: https://lore.kernel.org/r/20260223050804.4287-3-Ashish.Yadav@infineon.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/pmbus/pmbus.h
drivers/hwmon/pmbus/pmbus_core.c

index d2e9bfb5320fc423be091817e103d88c8d09265d..3ddcb742d289ec40c17c96c6751d9c32d5a79fc6 100644 (file)
@@ -416,7 +416,7 @@ enum pmbus_sensor_classes {
 #define PMBUS_PAGE_VIRTUAL     BIT(31) /* Page is virtual */
 
 enum pmbus_data_format { linear = 0, ieee754, direct, vid };
-enum vrm_version { vr11 = 0, vr12, vr13, imvp9, amd625mv };
+enum vrm_version { vr11 = 0, vr12, vr13, imvp9, amd625mv, nvidia195mv };
 
 /* PMBus revision identifiers */
 #define PMBUS_REV_10 0x00      /* PMBus revision 1.0 */
index 572be3ebc03df1bc555737eac8cf91f814f9ba53..7d73abecc050e29c05a277e3ffbd6554fe6a75b1 100644 (file)
@@ -891,6 +891,10 @@ static s64 pmbus_reg2data_vid(struct pmbus_data *data,
                if (val >= 0x0 && val <= 0xd8)
                        rv = DIV_ROUND_CLOSEST(155000 - val * 625, 100);
                break;
+       case nvidia195mv:
+               if (val >= 0x01)
+                       rv = 195 + (val - 1) * 5;  /* VID step is 5mv */
+               break;
        }
        return rv;
 }