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

    asus-wmi: fix hwmon/pwm1

to the 3.0-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:
     asus-wmi-fix-hwmon-pwm1.patch
and it can be found in the queue-3.0 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <sta...@kernel.org> know about it.


>From 49979d091d1847823c064301da1ec173619ddd92 Mon Sep 17 00:00:00 2001
From: Corentin Chary <corentin.ch...@gmail.com>
Date: Fri, 1 Jul 2011 11:34:26 +0200
Subject: asus-wmi: fix hwmon/pwm1

From: Corentin Chary <corentin.ch...@gmail.com>

commit 49979d091d1847823c064301da1ec173619ddd92 upstream.

The code was completly broken, and should never had been sent
to the kernel. That's what happens when you write code without
hardware to test it.

Signed-off-by: Corentin Chary <corentin.ch...@gmail.com>
Signed-off-by: Matthew Garrett <m...@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>

---
 drivers/platform/x86/asus-wmi.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -797,8 +797,8 @@ exit:
  * Hwmon device
  */
 static ssize_t asus_hwmon_pwm1(struct device *dev,
-                           struct device_attribute *attr,
-                           char *buf)
+                              struct device_attribute *attr,
+                              char *buf)
 {
        struct asus_wmi *asus = dev_get_drvdata(dev);
        u32 value;
@@ -809,7 +809,7 @@ static ssize_t asus_hwmon_pwm1(struct de
        if (err < 0)
                return err;
 
-       value |= 0xFF;
+       value &= 0xFF;
 
        if (value == 1) /* Low Speed */
                value = 85;
@@ -869,7 +869,7 @@ static mode_t asus_hwmon_sysfs_is_visibl
                 * - reverved bits are non-zero
                 * - sfun and presence bit are not set
                 */
-               if (value != ASUS_WMI_UNSUPPORTED_METHOD || value & 0xFFF80000
+               if (value == ASUS_WMI_UNSUPPORTED_METHOD || value & 0xFFF80000
                    || (!asus->sfun && !(value & ASUS_WMI_DSTS_PRESENCE_BIT)))
                        ok = false;
        }
@@ -904,6 +904,7 @@ static int asus_wmi_hwmon_init(struct as
                pr_err("Could not register asus hwmon device\n");
                return PTR_ERR(hwmon);
        }
+       dev_set_drvdata(hwmon, asus);
        asus->hwmon_device = hwmon;
        result = sysfs_create_group(&hwmon->kobj, &hwmon_attribute_group);
        if (result)


Patches currently in stable-queue which might be from corentin.ch...@gmail.com 
are

queue-3.0/asus-wmi-fix-hwmon-pwm1.patch
queue-3.0/asus-wmi-return-proper-value-in-store_cpufv.patch

_______________________________________________
stable mailing list
stable@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/stable

Reply via email to