Files
linux/drivers/hwmon
Stevens, Nick ec573efa13 hwmon: (mcp3021) Fix broken output scaling
commit 347d7e45bd upstream.

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>
[Guenter Roeck: Dropped unnecessary value check]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-03 09:29:46 -07:00
..
2013-05-04 14:46:28 -04:00
2012-11-28 11:50:34 -08:00
2013-04-07 21:16:41 -07:00
2012-11-28 11:50:34 -08:00
2013-02-06 09:58:07 -08:00
2012-11-28 11:50:34 -08:00
2012-11-28 11:50:34 -08:00
2013-03-18 21:19:49 +01:00
2013-04-07 21:16:42 -07:00
2012-11-28 11:50:34 -08:00
2012-11-28 11:50:34 -08:00
2012-10-10 15:25:56 +02:00
2012-11-28 11:49:40 -08:00
2012-11-28 11:49:40 -08:00
2012-11-28 11:50:34 -08:00
2012-11-28 11:50:34 -08:00
2012-11-28 11:50:34 -08:00
2012-11-28 11:50:34 -08:00
2012-11-28 11:50:34 -08:00
2012-11-28 11:50:34 -08:00