hwmon: (pmbus) Introduce and use cached vout margins
authorMårten Lindahl <marten.lindahl@axis.com>
Tue, 14 Jun 2022 09:38:54 +0000 (11:38 +0200)
committerGuenter Roeck <linux@roeck-us.net>
Wed, 13 Jul 2022 15:38:20 +0000 (08:38 -0700)
commit07fb76273db89d9340fa1fea2997d73fa3768ab9
tree500a59d874257de003e22dd0062b3defab1cbc0d
parentb674bcb13f418e0580878c21afbe14c4bdfa3138
hwmon: (pmbus) Introduce and use cached vout margins

When setting a new voltage the voltage boundaries are read every time to
check that the new voltage is within the proper range. Checking these
voltage boundaries consists of reading one of PMBUS_MFR_VOUT_MIN/
PMBUS_VOUT_MARGIN_LOW registers and then PMBUS_MFR_VOUT_MAX/
PMBUS_VOUT_MARGIN_HIGH together with writing the PMBUS_CLEAR_FAULTS
register.

Since these boundaries are never being changed, it can be cached and
thus saving unnecessary smbus transmissions.

Signed-off-by: Mårten Lindahl <marten.lindahl@axis.com>
Link: https://lore.kernel.org/r/20220614093856.3470672-2-marten.lindahl@axis.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/pmbus/pmbus_core.c