summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/pmbus/pmbus_core.c
diff options
context:
space:
mode:
authorErik Rosen <erik.rosen@metormote.com>2021-02-18 12:52:48 +0100
committerGuenter Roeck <linux@roeck-us.net>2021-04-20 06:50:14 -0700
commitd3e33067a6e4594edc70d0687feedb249079547c (patch)
tree0a5ad1023e8ac307a4526636ae5ed4f38c08b265 /drivers/hwmon/pmbus/pmbus_core.c
parentbfbbbe04d01222aa484400a7257f34a952af2237 (diff)
downloadlinux-d3e33067a6e4594edc70d0687feedb249079547c.tar.bz2
hwmon: (pmbus) Add pmbus_set_update() function to set update flag
For the STPDDC60 chip, the vout alarm-limits are represented as an offset relative to the commanded output voltage. This means that the limits are dynamic and must not be cached by the pmbus driver. This patch adds a pmbus_set_sensor() function to pmbus_core to be able to set the update flag on selected sensors after auto-detection of limit attributes. Signed-off-by: Erik Rosen <erik.rosen@metormote.com> Link: https://lore.kernel.org/r/20210218115249.28513-2-erik.rosen@metormote.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/pmbus/pmbus_core.c')
-rw-r--r--drivers/hwmon/pmbus/pmbus_core.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c
index aadea85fe630..e1de93658a64 100644
--- a/drivers/hwmon/pmbus/pmbus_core.c
+++ b/drivers/hwmon/pmbus/pmbus_core.c
@@ -141,6 +141,17 @@ void pmbus_clear_cache(struct i2c_client *client)
}
EXPORT_SYMBOL_GPL(pmbus_clear_cache);
+void pmbus_set_update(struct i2c_client *client, u8 reg, bool update)
+{
+ struct pmbus_data *data = i2c_get_clientdata(client);
+ struct pmbus_sensor *sensor;
+
+ for (sensor = data->sensors; sensor; sensor = sensor->next)
+ if (sensor->reg == reg)
+ sensor->update = update;
+}
+EXPORT_SYMBOL_GPL(pmbus_set_update);
+
int pmbus_set_page(struct i2c_client *client, int page, int phase)
{
struct pmbus_data *data = i2c_get_clientdata(client);