]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 6 Jan 2014 22:35:49 +0000 (14:35 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 6 Jan 2014 22:35:49 +0000 (14:35 -0800)
added patches:
hwmon-w83l768ng-fix-fan-speed-control-range.patch

queue-3.4/hwmon-w83l768ng-fix-fan-speed-control-range.patch [new file with mode: 0644]
queue-3.4/series

diff --git a/queue-3.4/hwmon-w83l768ng-fix-fan-speed-control-range.patch b/queue-3.4/hwmon-w83l768ng-fix-fan-speed-control-range.patch
new file mode 100644 (file)
index 0000000..108f2c1
--- /dev/null
@@ -0,0 +1,50 @@
+From 33a7ab91d509fa33b4bcd3ce0038cc80298050da Mon Sep 17 00:00:00 2001
+From: Jean Delvare <khali@linux-fr.org>
+Date: Thu, 12 Dec 2013 08:05:32 +0100
+Subject: hwmon: (w83l768ng) Fix fan speed control range
+
+From: Jean Delvare <khali@linux-fr.org>
+
+commit 33a7ab91d509fa33b4bcd3ce0038cc80298050da upstream.
+
+The W83L786NG stores the fan speed on 4 bits while the sysfs interface
+uses a 0-255 range. Thus the driver should scale the user input down
+to map it to the device range, and scale up the value read from the
+device before presenting it to the user. The reserved register nibble
+should be left unchanged.
+
+Signed-off-by: Jean Delvare <khali@linux-fr.org>
+Reviewed-by: Guenter Roeck <linux@roeck-us.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/hwmon/w83l786ng.c |    9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+--- a/drivers/hwmon/w83l786ng.c
++++ b/drivers/hwmon/w83l786ng.c
+@@ -481,9 +481,11 @@ store_pwm(struct device *dev, struct dev
+       if (err)
+               return err;
+       val = SENSORS_LIMIT(val, 0, 255);
++      val = DIV_ROUND_CLOSEST(val, 0x11);
+       mutex_lock(&data->update_lock);
+-      data->pwm[nr] = val;
++      data->pwm[nr] = val * 0x11;
++      val |= w83l786ng_read_value(client, W83L786NG_REG_PWM[nr]) & 0xf0;
+       w83l786ng_write_value(client, W83L786NG_REG_PWM[nr], val);
+       mutex_unlock(&data->update_lock);
+       return count;
+@@ -782,8 +784,9 @@ static struct w83l786ng_data *w83l786ng_
+                           ? 0 : 1;
+                       data->pwm_enable[i] =
+                           ((pwmcfg >> W83L786NG_PWM_ENABLE_SHIFT[i]) & 3) + 1;
+-                      data->pwm[i] = w83l786ng_read_value(client,
+-                          W83L786NG_REG_PWM[i]);
++                      data->pwm[i] =
++                          (w83l786ng_read_value(client, W83L786NG_REG_PWM[i])
++                           & 0x0f) * 0x11;
+               }
index c94106041aff367c9f77d6ffa9417f0600161bb0..a2f68d0418f385df8ce0d708769a2dd9d784b862 100644 (file)
@@ -40,3 +40,4 @@ sched-avoid-throttle_cfs_rq-racing-with-period_timer-stopping.patch
 sh-always-link-in-helper-functions-extracted-from-libgcc.patch
 selinux-look-for-ipsec-labels-on-both-inbound-and-outbound-packets.patch
 selinux-process-labeled-ipsec-tcp-syn-ack-packets-properly-in-selinux_ip_postroute.patch
+hwmon-w83l768ng-fix-fan-speed-control-range.patch