summaryrefslogtreecommitdiff
path: root/drivers/staging/iio
diff options
context:
space:
mode:
authorKristina Martšenko <kristina.martsenko@gmail.com>2015-01-25 16:28:22 (GMT)
committerJonathan Cameron <jic23@kernel.org>2015-01-26 21:00:54 (GMT)
commit89bb35e200bee745c539a96666e0792301ca40f1 (patch)
tree11d82d0563a0d8fdc675572be8c93fe168726d8e /drivers/staging/iio
parent6abe0300a1d5242f4ff89257197f284679af1a06 (diff)
downloadlinux-89bb35e200bee745c539a96666e0792301ca40f1.tar.xz
iio: mxs-lradc: only update the buffer when its conversions have finished
Using the touchscreen while running buffered capture results in the buffer reporting lots of wrong values, often just zeros. This is because we push readings to the buffer every time a touchscreen interrupt arrives, including when the buffer's own conversions have not yet finished. So let's only push to the buffer when its conversions are ready. Signed-off-by: Kristina Martšenko <kristina.martsenko@gmail.com> Reviewed-by: Marek Vasut <marex@denx.de> Cc: Stable@vger.kernel.org Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/staging/iio')
-rw-r--r--drivers/staging/iio/adc/mxs-lradc.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/staging/iio/adc/mxs-lradc.c b/drivers/staging/iio/adc/mxs-lradc.c
index d2e0c27..ebcbd12 100644
--- a/drivers/staging/iio/adc/mxs-lradc.c
+++ b/drivers/staging/iio/adc/mxs-lradc.c
@@ -1152,10 +1152,12 @@ static irqreturn_t mxs_lradc_handle_irq(int irq, void *data)
LRADC_CTRL1_LRADC_IRQ(TOUCHSCREEN_VCHANNEL2));
}
- if (iio_buffer_enabled(iio))
- iio_trigger_poll(iio->trig);
- else if (reg & LRADC_CTRL1_LRADC_IRQ(0))
+ if (iio_buffer_enabled(iio)) {
+ if (reg & lradc->buffer_vchans)
+ iio_trigger_poll(iio->trig);
+ } else if (reg & LRADC_CTRL1_LRADC_IRQ(0)) {
complete(&lradc->completion);
+ }
mxs_lradc_reg_clear(lradc, reg & clr_irq, LRADC_CTRL1);