]> git.karo-electronics.de Git - karo-tx-linux.git/commit
iio: adc: meson-saradc: improve meson_sar_adc_read_raw_sample
authorHeiner Kallweit <hkallweit1@gmail.com>
Wed, 15 Feb 2017 19:31:55 +0000 (20:31 +0100)
committerJonathan Cameron <jic23@kernel.org>
Sun, 19 Feb 2017 12:53:27 +0000 (12:53 +0000)
commit6a882a2cbeb09b7c32610a644d5915d17b80b617
tree8d0e7036d3a9b3045b6813638bef100ca47b9ddd
parent3af109131b7eb880ba0711344912d7a523a812b4
iio: adc: meson-saradc: improve meson_sar_adc_read_raw_sample

After sampling there should always be only one value in the FIFO.
This also applies to averaging mode as the averaging is done
chip-internally. So we don't have to loop and let the driver
complain if there's not exactly one value in the FIFO.

If the value belongs to a different channel then don't silently
swallow the value but complain.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Acked-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/adc/meson_saradc.c