Commit e7f3db14 authored by Kristina Martšenko's avatar Kristina Martšenko Committed by Greg Kroah-Hartman

iio: mxs-lradc: only update the buffer when its conversions have finished

commit 89bb35e2 upstream.

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: default avatarKristina Martšenko <kristina.martsenko@gmail.com>
Reviewed-by: default avatarMarek Vasut <marex@denx.de>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a1c5b58e
...@@ -1160,9 +1160,12 @@ static irqreturn_t mxs_lradc_handle_irq(int irq, void *data) ...@@ -1160,9 +1160,12 @@ static irqreturn_t mxs_lradc_handle_irq(int irq, void *data)
} }
if (iio_buffer_enabled(iio)) if (iio_buffer_enabled(iio))
iio_trigger_poll(iio->trig, iio_get_time_ns()); if (iio_buffer_enabled(iio)) {
else if (reg & LRADC_CTRL1_LRADC_IRQ(0)) if (reg & lradc->buffer_vchans)
iio_trigger_poll(iio->trig, iio_get_time_ns());
} else if (reg & LRADC_CTRL1_LRADC_IRQ(0)) {
complete(&lradc->completion); complete(&lradc->completion);
}
mxs_lradc_reg_clear(lradc, reg & clr_irq, LRADC_CTRL1); mxs_lradc_reg_clear(lradc, reg & clr_irq, LRADC_CTRL1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment