]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
iio: adc: xilinx: Fix VREFP scale
authorThomas Betker <thomas.betker@rohde-schwarz.com>
Wed, 15 Apr 2015 19:11:49 +0000 (21:11 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 6 Jun 2015 15:20:55 +0000 (08:20 -0700)
commit 00db4e52f4541965f7fda225eb458a75f892017b upstream.

The scaling factor for VREFP is 3.0/4096, not 1.0/4096; fix this to get
correct readings.

Signed-off-by: Thomas Betker <thomas.betker@rohde-schwarz.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/adc/xilinx-xadc-core.c

index 0ad7b502c593d90b2f070acf6c9ca73588bce9d3..6fa629b3c168a7e6125d15c82590bc36b6969ce1 100644 (file)
@@ -856,6 +856,7 @@ static int xadc_read_raw(struct iio_dev *indio_dev,
                        switch (chan->address) {
                        case XADC_REG_VCCINT:
                        case XADC_REG_VCCAUX:
+                       case XADC_REG_VREFP:
                        case XADC_REG_VCCBRAM:
                        case XADC_REG_VCCPINT:
                        case XADC_REG_VCCPAUX: