hwmon: (pmbus) Add function to clear sensor cache
authorGuenter Roeck <linux@roeck-us.net>
Sat, 26 Jan 2013 23:15:37 +0000 (15:15 -0800)
committerGuenter Roeck <linux@roeck-us.net>
Wed, 6 Feb 2013 17:58:04 +0000 (09:58 -0800)
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>
drivers/hwmon/pmbus/pmbus.h
drivers/hwmon/pmbus/pmbus_core.c

index 164d17706486023a5c267b805e51e941f3bc1374..fa9beb3eb60ca2a33cc6150542dfcbbc90b84219 100644 (file)
@@ -369,6 +369,7 @@ struct pmbus_driver_info {
 
 /* Function declarations */
 
+void pmbus_clear_cache(struct i2c_client *client);
 int pmbus_set_page(struct i2c_client *client, u8 page);
 int pmbus_read_word_data(struct i2c_client *client, u8 page, u8 reg);
 int pmbus_write_word_data(struct i2c_client *client, u8 page, u8 reg, u16 word);
index 3b5c24dd0b75d9a84cf1363d0919316fe139bd5b..32f4530cd1e8b558abebe821017df74d253173a8 100644 (file)
@@ -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);
This page took 0.035128 seconds and 5 git commands to generate.