This is a note to let you know that I've just added the patch titled

    hwmon: (max6639) Fix FAN_FROM_REG calculation

to the 3.2-stable tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     hwmon-max6639-fix-fan_from_reg-calculation.patch
and it can be found in the queue-3.2 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


>From b63d97a36edb1aecf8c13e5f5783feff4d64c24b Mon Sep 17 00:00:00 2001
From: Chris D Schimp <[email protected]>
Date: Mon, 20 Feb 2012 16:59:24 -0500
Subject: hwmon: (max6639) Fix FAN_FROM_REG calculation

From: Chris D Schimp <[email protected]>

commit b63d97a36edb1aecf8c13e5f5783feff4d64c24b upstream.

RPM calculation from tachometer value does not depend on PPR.
Also, do not report negative RPM values.

Signed-off-by: Chris D Schimp <[email protected]>
[[email protected]: do not report negative RPM values]
Signed-off-by: Guenter Roeck <[email protected]>
Acked-by: Roland Stigge <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 drivers/hwmon/max6639.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/drivers/hwmon/max6639.c
+++ b/drivers/hwmon/max6639.c
@@ -72,8 +72,8 @@ static unsigned short normal_i2c[] = { 0
 
 static const int rpm_ranges[] = { 2000, 4000, 8000, 16000 };
 
-#define FAN_FROM_REG(val, div, rpm_range)      ((val) == 0 ? -1 : \
-       (val) == 255 ? 0 : (rpm_ranges[rpm_range] * 30) / ((div + 1) * (val)))
+#define FAN_FROM_REG(val, rpm_range)   ((val) == 0 || (val) == 255 ? \
+                               0 : (rpm_ranges[rpm_range] * 30) / (val))
 #define TEMP_LIMIT_TO_REG(val) SENSORS_LIMIT((val) / 1000, 0, 255)
 
 /*
@@ -333,7 +333,7 @@ static ssize_t show_fan_input(struct dev
                return PTR_ERR(data);
 
        return sprintf(buf, "%d\n", FAN_FROM_REG(data->fan[attr->index],
-                      data->ppr, data->rpm_range));
+                      data->rpm_range));
 }
 
 static ssize_t show_alarm(struct device *dev,


Patches currently in stable-queue which might be from [email protected] are

queue-3.2/hwmon-max6639-fix-fan_from_reg-calculation.patch
queue-3.2/hwmon-max6639-fix-ppr-register-initialization-to-set-both-channels.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to