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>
Wed, 8 Jan 2014 17:42:12 +0000 (09:42 -0800)
commitb7a9e22f44afe81e1252ad0aeb6b145af93103e0
tree127ae71497c09353421779a4f76fa419e2e169d9
parent420cc6d77fd83ab28ebed7ab1dc9018ab351ec12
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