summaryrefslogtreecommitdiff
path: root/drivers/hwmon/pmbus/pmbus_core.c
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2013-01-26 15:15:37 -0800
committerGuenter Roeck <linux@roeck-us.net>2013-02-06 09:58:04 -0800
commitce603b18f30aea1216a00673a33805d4f5a5e16b (patch)
treed96326369050cf4e63388a07125bd0a9884d3846 /drivers/hwmon/pmbus/pmbus_core.c
parentaebcbbfc4955929286a15a04592a2281d3e527db (diff)
hwmon: (pmbus) Add function to clear sensor cache
For PMBus chips, modifying one limit register may affect other limits. Since limits are all cached in the PMBus core driver, related changes are not reflected in reported limits. Introduce function to clear the attribute cache. After calling this function, the core pmbus driver re-reads all cached values. 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.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c
index 3b5c24dd0b75..32f4530cd1e8 100644
--- a/drivers/hwmon/pmbus/pmbus_core.c
+++ b/drivers/hwmon/pmbus/pmbus_core.c
@@ -113,6 +113,14 @@ struct pmbus_data {
u8 currpage;
};
+void pmbus_clear_cache(struct i2c_client *client)
+{
+ struct pmbus_data *data = i2c_get_clientdata(client);
+
+ data->valid = false;
+}
+EXPORT_SYMBOL_GPL(pmbus_clear_cache);
+
int pmbus_set_page(struct i2c_client *client, u8 page)
{
struct pmbus_data *data = i2c_get_clientdata(client);