]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
hwmon: (pmbus/core) honor vrm_version in pmbus_data2reg_vid()
authorAbdurrahman Hussain <abdurrahman@nexthop.ai>
Sat, 20 Jun 2026 07:50:37 +0000 (00:50 -0700)
committerGuenter Roeck <linux@roeck-us.net>
Mon, 29 Jun 2026 15:44:41 +0000 (08:44 -0700)
commit828cd614e2af053ca5e1d6da767bbd8a1b5cabfb
tree4967efd7a144bf49c8294122d44c6e07fe3f2166
parente31408734332b8cc611342cdaaab6ba492180156
hwmon: (pmbus/core) honor vrm_version in pmbus_data2reg_vid()

pmbus_data2reg_vid() hardcoded the VR11 encoding regardless of the
vrm_version configured by the driver, while pmbus_reg2data_vid()
already switched on it. Any driver that selects a non-VR11 VID mode
and exposes a regulator (or hwmon vout setter) sent dangerously
wrong codes to PMBUS_VOUT_COMMAND -- e.g. an nvidia195mv part asked
for 200 mV got the VR11 clamp to 500 mV encoded as 0xB2, which the
chip interprets as 1080 mV.

Mirror pmbus_reg2data_vid() so writes round-trip with reads.

Signed-off-by: Abdurrahman Hussain <abdurrahman@nexthop.ai>
Assisted-by: Claude:claude-opus-4-7 [Claude Code]
Link: https://lore.kernel.org/r/20260620-pmbus-data2reg-vid-v1-1-5518030432c4@nexthop.ai
Fixes: 068c227056b92 ("hwmon: (pmbus) Add support for VR12")
Fixes: d4977c083aeb2 ("hwmon: (pmbus) Add support for Intel VID protocol VR13")
Fixes: 9d72340b6ade9 ("hwmon: (pmbus/core) Add support for Intel IMVP9 and AMD 6.25mV modes")
Fixes: 969a4ec86ca5f ("hwmon: (pmbus/core) Add support for NVIDIA nvidia195mv mode")
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/pmbus/pmbus_core.c