aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2007-06-24 05:19:01 -0400
committerMark M. Hoffman <mhoffman@lightlink.com>2007-07-19 14:22:17 -0400
commit6b3e46458049fe556c2346a347c4540e532db288 (patch)
treee5acce165cd5df721285f6046f2af5fda7739fd9 /drivers/hwmon
parent475ef85512900dcb87435e13656c1f5e724de379 (diff)
hwmon/w83627ehf: Fix timing issues
* I have experimental evidence that the W83627EHG needs more than 1 second to refresh all the measured values. Increase the caching time to 1.5 second. * When changing a fan clock divider, the corresponding fan speed measurement register is no longer valid, until the next time the chip will refresh it. One way to fix this is to pretend that the cache is still valid for one more period (1.5 second.) Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/w83627ehf.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/hwmon/w83627ehf.c b/drivers/hwmon/w83627ehf.c
index e615b8378fc3..0c2d929cf573 100644
--- a/drivers/hwmon/w83627ehf.c
+++ b/drivers/hwmon/w83627ehf.c
@@ -421,7 +421,7 @@ static struct w83627ehf_data *w83627ehf_update_device(struct device *dev)
421 421
422 mutex_lock(&data->update_lock); 422 mutex_lock(&data->update_lock);
423 423
424 if (time_after(jiffies, data->last_updated + HZ) 424 if (time_after(jiffies, data->last_updated + HZ + HZ/2)
425 || !data->valid) { 425 || !data->valid) {
426 /* Fan clock dividers */ 426 /* Fan clock dividers */
427 i = w83627ehf_read_value(data, W83627EHF_REG_FANDIV1); 427 i = w83627ehf_read_value(data, W83627EHF_REG_FANDIV1);
@@ -727,6 +727,8 @@ store_fan_min(struct device *dev, struct device_attribute *attr,
727 div_from_reg(new_div)); 727 div_from_reg(new_div));
728 data->fan_div[nr] = new_div; 728 data->fan_div[nr] = new_div;
729 w83627ehf_write_fan_div(data, nr); 729 w83627ehf_write_fan_div(data, nr);
730 /* Give the chip time to sample a new speed value */
731 data->last_updated = jiffies;
730 } 732 }
731 w83627ehf_write_value(data, W83627EHF_REG_FAN_MIN[nr], 733 w83627ehf_write_value(data, W83627EHF_REG_FAN_MIN[nr],
732 data->fan_min[nr]); 734 data->fan_min[nr]);