https://github.com/torvalds/linux
Revision 347d7e45bd09ce09cbc30d5cea9de377eb22f55c authored by Stevens, Nick on 01 July 2015, 16:07:41 UTC, committed by Guenter Roeck on 01 July 2015, 20:56:27 UTC
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>
1 parent 56172d8
History
Tip revision: 347d7e45bd09ce09cbc30d5cea9de377eb22f55c authored by Stevens, Nick on 01 July 2015, 16:07:41 UTC
hwmon: (mcp3021) Fix broken output scaling
Tip revision: 347d7e4
File Mode Size
Documentation
arch
block
crypto
drivers
firmware
fs
include
init
ipc
kernel
lib
mm
net
samples
scripts
security
sound
tools
usr
virt
.gitignore -rw-r--r-- 1.2 KB
.mailmap -rw-r--r-- 5.1 KB
COPYING -rw-r--r-- 18.3 KB
CREDITS -rw-r--r-- 94.6 KB
Kbuild -rw-r--r-- 2.6 KB
Kconfig -rw-r--r-- 252 bytes
MAINTAINERS -rw-r--r-- 311.8 KB
Makefile -rw-r--r-- 53.1 KB
README -rw-r--r-- 18.2 KB
REPORTING-BUGS -rw-r--r-- 7.3 KB

README

back to top