Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=72240307e988627df46553846936aa89a0f6a283
Commit:     72240307e988627df46553846936aa89a0f6a283
Parent:     21df67b191fd612fa28aedd39ec1414d8effc454
Author:     Jean Delvare <[EMAIL PROTECTED]>
AuthorDate: Tue Oct 23 14:02:24 2007 +0200
Committer:  Mark M. Hoffman <[EMAIL PROTECTED]>
CommitDate: Thu Feb 7 20:39:41 2008 -0500

    hwmon: (gl518sm) Fix the reported fan speed
    
    The fan speeds reported by the gl518sm driver are twice as much as they
    should. It's currently reporting the number of pulses per minute, not
    rotations per minute, while typical fans emit two pulses per rotation.
    This explains why all reports with this driver had very high speed
    values (between 9000 to 12000 RPM). Odd that nobody ever actually
    complained about this bug.
    
    Signed-off-by: Jean Delvare <[EMAIL PROTECTED]>
    Signed-off-by: Mark M. Hoffman <[EMAIL PROTECTED]>
---
 drivers/hwmon/gl518sm.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/hwmon/gl518sm.c b/drivers/hwmon/gl518sm.c
index c525511..3b1ac48 100644
--- a/drivers/hwmon/gl518sm.c
+++ b/drivers/hwmon/gl518sm.c
@@ -96,10 +96,10 @@ static inline u8 FAN_TO_REG(long rpm, int div)
        long rpmdiv;
        if (rpm == 0)
                return 0;
-       rpmdiv = SENSORS_LIMIT(rpm, 1, 1920000) * div;
-       return SENSORS_LIMIT((960000 + rpmdiv / 2) / rpmdiv, 1, 255);
+       rpmdiv = SENSORS_LIMIT(rpm, 1, 960000) * div;
+       return SENSORS_LIMIT((480000 + rpmdiv / 2) / rpmdiv, 1, 255);
 }
-#define FAN_FROM_REG(val,div)  ((val)==0 ? 0 : (960000/((val)*(div))))
+#define FAN_FROM_REG(val,div)  ((val)==0 ? 0 : (480000/((val)*(div))))
 
 #define IN_TO_REG(val)         (SENSORS_LIMIT((((val)+9)/19),0,255))
 #define IN_FROM_REG(val)       ((val)*19)
-
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