Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6b3e46458049fe556c2346a347c4540e532db288
Commit:     6b3e46458049fe556c2346a347c4540e532db288
Parent:     475ef85512900dcb87435e13656c1f5e724de379
Author:     Jean Delvare <[EMAIL PROTECTED]>
AuthorDate: Sun Jun 24 11:19:01 2007 +0200
Committer:  Mark M. Hoffman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 19 14:22:17 2007 -0400

    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 <[EMAIL PROTECTED]>
    Signed-off-by: Mark M. Hoffman <[EMAIL PROTECTED]>
---
 drivers/hwmon/w83627ehf.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/hwmon/w83627ehf.c b/drivers/hwmon/w83627ehf.c
index e615b83..0c2d929 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)
 
        mutex_lock(&data->update_lock);
 
-       if (time_after(jiffies, data->last_updated + HZ)
+       if (time_after(jiffies, data->last_updated + HZ + HZ/2)
         || !data->valid) {
                /* Fan clock dividers */
                i = w83627ehf_read_value(data, W83627EHF_REG_FANDIV1);
@@ -727,6 +727,8 @@ store_fan_min(struct device *dev, struct device_attribute 
*attr,
                        div_from_reg(new_div));
                data->fan_div[nr] = new_div;
                w83627ehf_write_fan_div(data, nr);
+               /* Give the chip time to sample a new speed value */
+               data->last_updated = jiffies;
        }
        w83627ehf_write_value(data, W83627EHF_REG_FAN_MIN[nr],
                              data->fan_min[nr]);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to