diff options
| author | Stevens, Nick <Nick.Stevens@digi.com> | 2015-07-01 16:07:41 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-08-03 09:29:46 -0700 |
| commit | ec573efa13d9e957199f008c12d39d54ab3f61d1 (patch) | |
| tree | 93bd8d7f8404b0a6798c5665a5e0677f551106ab /include/uapi/linux/errqueue.h | |
| parent | 42f77f15b1fdab86d7d968232776eba3e9b4e135 (diff) | |
hwmon: (mcp3021) Fix broken output scaling
commit 347d7e45bd09ce09cbc30d5cea9de377eb22f55c 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>
Diffstat (limited to 'include/uapi/linux/errqueue.h')
0 files changed, 0 insertions, 0 deletions
