Stevens, Nick 347d7e45bd hwmon: (mcp3021) Fix broken output scaling
The mcp3021 scaling code is dividing the VDD (full-scale) value in
millivolts by the A2D resolution to obtain the scaling factor. When VDD
is 3300mV (the standard value) and the resolution is 12-bit (4096
divisions), the result is a scale factor of 3300/4096, which is always
one.  Effectively, the raw A2D reading is always being returned because
no scaling is applied.

This patch fixes the issue and simplifies the register-to-volts
calculation, removing the unneeded "output_scale" struct member.

Signed-off-by: Nick Stevens <Nick.Stevens@digi.com>
Cc: stable@vger.kernel.org # v3.10+
[Guenter Roeck: Dropped unnecessary value check]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2015-07-01 13:56:27 -07:00
..
2015-06-26 11:08:27 -07:00
2015-06-26 15:07:37 -07:00
2015-06-26 11:54:29 -07:00
2015-06-26 15:07:37 -07:00
2015-06-26 14:51:15 -07:00
2015-06-26 11:54:29 -07:00
2015-06-29 11:10:56 -07:00
2015-06-26 15:46:08 -07:00
2015-06-26 11:54:29 -07:00
2015-06-13 08:44:14 -07:00
2015-06-25 18:55:33 -07:00
2015-06-26 14:51:15 -07:00
2015-06-26 11:54:29 -07:00
2015-06-19 01:18:43 +02:00
2015-06-23 13:32:38 -07:00
2015-06-25 17:15:18 -07:00
2015-06-26 11:54:29 -07:00
2015-06-28 12:32:13 -07:00