Re: [PATCH v4 3/4] hwmon: (pmbus_core) Support relative encoding of vout related commands

From: Guenter Roeck

Date: Sun Oct 25 2026 - 20:40:12 EST


On Tue, Oct 20, 2026 at 08:02:07PM -0700, Abdurrahman Hussain wrote:
> From: Lars Petter Mostad <lars.petter.mostad@xxxxxxxxxx>
>
> PMBus 1.3 allows for relative encoding of voltages in certain output
> voltage related commands. These commands are encoded relative to
> VOUT_COMMAND. Support this when encoding/decoding commands.
>
> Signed-off-by: Lars Petter Mostad <lars.petter.mostad@xxxxxxxxxx>
> [abdurrahman: rebased; check VOUT_MODE for 0xff before testing the
> relative bit; use signed division and clamp the user value before
> scaling; reject a VOUT_COMMAND that decodes to 0 or less, or above
> INT_MAX mV, at probe and from the regulator, and scale the relative
> limits by it without overflowing s64; update the cached VOUT_COMMAND
> only after a successful write; decode the regulator margins with the
> register they were read from, and in relative mode bound the output
> voltage only by MFR_VOUT_MIN/MAX, since VOUT_MARGIN_LOW/HIGH move with
> VOUT_COMMAND]
> Signed-off-by: Abdurrahman Hussain <abdurrahman@xxxxxxxxxx>

Applied.

Thanks,
Guenter