hwmon: (w83l768ng) Fix fan speed control range
authorJean Delvare <khali@linux-fr.org>
Thu, 12 Dec 2013 07:05:32 +0000 (08:05 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 20 Dec 2013 15:45:08 +0000 (07:45 -0800)
commita903818b46ee2bf0c9a0bc7d1fa80ed4b72083c2
treea615e266361f81886a52a00f916d3deac4e37ffe
parentd6eb2d04bb8bcf9c899630fee2072477096c7599
hwmon: (w83l768ng) Fix fan speed control range

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