Skip to content

Commit

Permalink
iio: adc: ab8500-gpadc: Fix off by 10 to 3
Browse files Browse the repository at this point in the history
Fix an off by three orders of magnitude error in the AB8500
GPADC driver. Luckily it showed up quite quickly when trying
to make use of it. The processed reads were returning
microvolts, microamperes and microcelsius instead of millivolts,
milliamperes and millicelsius as advertised.

Cc: stable@vger.kernel.org
Fixes: 07063bb ("iio: adc: New driver for the AB8500 GPADC")
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20201224011700.1059659-1-linus.walleij@linaro.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
  • Loading branch information
Linus Walleij authored and Jonathan Cameron committed Feb 21, 2021
1 parent 121875b commit 4f54340
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/iio/adc/ab8500-gpadc.c
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,7 @@ static int ab8500_gpadc_read_raw(struct iio_dev *indio_dev,
return processed;

/* Return millivolt or milliamps or millicentigrades */
*val = processed * 1000;
*val = processed;
return IIO_VAL_INT;
}

Expand Down

0 comments on commit 4f54340

Please sign in to comment.