summaryrefslogtreecommitdiffstats
path: root/drivers/iio/adc/twl4030-madc.c
diff options
context:
space:
mode:
authorPaul Kocialkowski <contact@paulk.fr>2014-05-24 14:09:00 +0200
committerJonathan Cameron <jic23@kernel.org>2014-06-02 22:53:27 +0200
commite0326be0cded13dfc3a24cbeece1f1ae64348a0e (patch)
tree636046ef3ca6cdc3f1f4752317f053be98d8a961 /drivers/iio/adc/twl4030-madc.c
parentstaging: iio: tsl2x7x_core: fix proximity treshold (diff)
downloadlinux-e0326be0cded13dfc3a24cbeece1f1ae64348a0e.tar.xz
linux-e0326be0cded13dfc3a24cbeece1f1ae64348a0e.zip
twl4030-madc: Request processed values in twl4030_get_madc_conversion
Not setting the raw parameter in the request causes it to be randomly initialized to a value that might be different from zero or zero. This leads to values that are randomly either raw or processed, making it very difficult to make reliable use of the values. Cc: Stable@vger.kernel.org Signed-off-by: Paul Kocialkowski <contact@paulk.fr> Acked-by: Sebastian Reichel <sre@kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/adc/twl4030-madc.c')
-rw-r--r--drivers/iio/adc/twl4030-madc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/iio/adc/twl4030-madc.c b/drivers/iio/adc/twl4030-madc.c
index 7de1c4c87942..eb86786e698e 100644
--- a/drivers/iio/adc/twl4030-madc.c
+++ b/drivers/iio/adc/twl4030-madc.c
@@ -645,6 +645,7 @@ int twl4030_get_madc_conversion(int channel_no)
req.channels = (1 << channel_no);
req.method = TWL4030_MADC_SW2;
req.active = 0;
+ req.raw = 0;
req.func_cb = NULL;
ret = twl4030_madc_conversion(&req);
if (ret < 0)