]> git.karo-electronics.de Git - linux-beck.git/commitdiff
twl4030-madc: Request processed values in twl4030_get_madc_conversion
authorPaul Kocialkowski <contact@paulk.fr>
Sat, 24 May 2014 12:09:00 +0000 (13:09 +0100)
committerJonathan Cameron <jic23@kernel.org>
Mon, 2 Jun 2014 20:53:27 +0000 (21:53 +0100)
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>
drivers/iio/adc/twl4030-madc.c

index 7de1c4c87942326bbf11e7519ddfa17d29f263f9..eb86786e698eabf702655f9f974c9639956169c7 100644 (file)
@@ -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)