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-04-07 21:16:41 -07:00
2013-04-16 18:27:52 -07:00
2013-04-07 21:16:38 -07:00
2013-05-13 08:07:13 -07:00
2013-05-04 14:46:28 -04:00
2013-04-16 18:27:52 -07:00
2013-01-26 00:37:24 +01:00
2013-04-07 21:16:42 -07:00
2013-01-25 21:03:54 -08:00
2012-09-23 21:08:29 -07:00
2012-11-28 11:50:34 -08:00
2014-07-17 15:58:01 -07:00
2012-07-21 21:48:38 -07:00
2013-04-07 21:16:40 -07:00
2014-07-17 15:58:00 -07:00
2014-07-17 15:58:00 -07:00
2013-04-07 21:16:40 -07:00
2014-09-05 16:28:35 -07:00
2013-01-25 21:03:54 -08:00
2013-04-07 21:16:40 -07:00
2013-04-07 21:16:38 -07:00
2013-04-07 21:16:38 -07:00
2013-04-07 21:16:41 -07:00
2013-04-07 21:16:38 -07:00
2013-04-07 21:16:40 -07:00
2013-01-25 21:03:54 -08:00
2014-07-28 08:00:03 -07:00
2013-01-25 21:03:54 -08:00
2014-07-17 15:58:00 -07:00
2013-10-18 07:45:44 -07:00
2013-04-07 21:16:40 -07:00
2013-04-07 21:16:40 -07:00
2013-01-26 00:37:24 +01:00
2012-07-21 21:48:39 -07:00
2014-01-25 08:27:11 -08:00
2014-07-28 08:00:03 -07:00
2014-07-28 08:00:03 -07:00
2014-09-05 16:28:35 -07:00
2012-09-23 21:08:31 -07:00
2012-07-21 21:48:39 -07:00
2013-01-25 21:03:54 -08:00
2014-06-07 13:25:31 -07:00
2013-01-25 21:03:54 -08:00
2013-04-07 21:16:38 -07:00
2013-01-25 21:03:54 -08:00
2013-01-25 21:03:54 -08:00
2013-04-07 21:16:40 -07:00
2013-04-07 21:16:40 -07:00
2013-01-25 21:03:54 -08:00
2013-04-07 21:16:40 -07:00
2013-01-25 21:03:54 -08:00
2014-09-05 16:28:35 -07:00
2013-12-20 07:45:07 -08:00
2012-12-19 22:17:02 +01:00
2012-12-19 22:16:59 +01:00
2012-11-28 11:50:34 -08:00
2013-04-07 21:16:40 -07:00
2013-04-07 21:16:40 -07:00
2013-05-13 06:43:14 -07:00
2014-07-09 11:14:01 -07:00
2013-02-06 09:57:59 -08:00
2013-04-07 21:16:40 -07:00
2013-02-06 09:58:07 -08:00
2012-11-28 11:50:34 -08:00
2013-04-07 21:16:40 -07:00
2014-02-06 11:08:14 -08:00
2014-06-11 12:03:22 -07:00
2013-03-14 06:55:21 -07:00
2013-01-25 21:03:54 -08:00
2012-11-28 11:50:34 -08:00
2013-02-06 09:57:58 -08:00
2013-05-04 14:49:36 +02:00
2013-03-18 21:19:49 +01:00
2013-01-25 21:03:54 -08:00
2014-09-05 16:28:35 -07:00
2013-04-07 21:16:40 -07:00
2012-07-21 21:48:38 -07:00
2014-09-05 16:28:35 -07:00
2012-07-21 21:48:40 -07:00
2013-11-29 11:11:50 -08:00
2012-10-10 15:25:56 +02:00
2013-04-07 21:16:40 -07:00
2013-04-07 21:16:42 -07:00
2012-09-23 21:08:31 -07:00
2013-01-25 21:03:54 -08:00
2013-04-07 21:16:40 -07:00
2013-04-07 21:16:40 -07:00
2013-04-07 21:16:40 -07:00
2013-04-07 21:16:40 -07:00
2013-04-30 15:15:24 -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
2014-03-06 21:30:11 -08:00
2013-01-25 21:03:54 -08:00
2013-01-25 21:03:54 -08:00
2013-01-25 21:03:54 -08:00
2013-08-11 18:35:21 -07:00
2013-01-25 21:03:54 -08:00
2013-04-07 21:16:37 -07:00
2015-08-03 09:29:46 -07:00
2013-07-25 14:07:27 -07:00
2015-06-05 23:19:54 -07:00
2013-04-07 21:16:40 -07:00
2013-04-07 21:16:40 -07:00
2012-07-21 21:48:41 -07:00
2013-04-07 21:16:38 -07:00
2013-04-07 21:16:40 -07:00
2012-05-30 07:55:38 +02:00
2012-11-28 11:49:40 -08:00
2012-11-28 11:49:40 -08:00
2013-03-03 21:45:48 -08:00
2012-11-28 11:50:34 -08:00
2014-09-05 16:28:35 -07:00
2012-10-10 15:25:56 +02:00
2012-11-28 11:50:34 -08:00
2013-01-25 21:03:54 -08:00
2014-07-31 12:53:51 -07:00
2013-04-07 21:16:40 -07:00
2013-04-07 21:16:40 -07:00
2013-05-19 08:19:29 -07:00
2013-04-07 21:16:40 -07:00
2012-12-16 18:21:33 -08:00
2012-11-28 11:50:34 -08:00
2013-01-09 21:47:22 -08:00
2013-04-07 21:16:40 -07:00
2012-11-28 11:50:34 -08:00
2013-04-07 21:16:40 -07:00
2013-12-20 07:45:07 -08:00
2012-07-21 21:48:43 -07:00
2013-12-20 07:45:08 -08:00
2013-04-07 21:16:40 -07:00
2013-01-25 21:03:54 -08:00
2013-04-07 21:16:40 -07:00
2013-04-07 21:16:40 -07:00
2013-04-07 21:16:40 -07:00
2013-04-07 21:16:40 -07:00
2013-04-07 21:16:40 -07:00
2012-11-28 11:50:34 -08:00
2012-11-28 11:50:34 -08:00