Re: [PATCH] hwmon: (pmbus/core) honor vrm_version in pmbus_data2reg_vid()
From: Guenter Roeck
Date: Mon Jun 29 2026 - 11:48:51 EST
On Sat, Jun 20, 2026 at 12:50:37AM -0700, Abdurrahman Hussain wrote:
> 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@xxxxxxxxxx>
> Assisted-by: Claude:claude-opus-4-7 [Claude Code]
Applied.
Thanks,
Guenter