Skip to content

Commit 30fa0db

Browse files
kristina-martsenkosashalevin
authored andcommitted
iio: mxs-lradc: only update the buffer when its conversions have finished
commit 89bb35e 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: Kristina Martšenko <kristina.martsenko@gmail.com> Reviewed-by: Marek Vasut <marex@denx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
1 parent 9f074c6 commit 30fa0db

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎drivers/staging/iio/adc/mxs-lradc.c‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1150,10 +1150,12 @@ static irqreturn_t mxs_lradc_handle_irq(int irq, void *data)
11501150
LRADC_CTRL1_LRADC_IRQ(TOUCHSCREEN_VCHANNEL2));
11511151
}
11521152

1153-
if (iio_buffer_enabled(iio))
1154-
iio_trigger_poll(iio->trig);
1155-
else if (reg & LRADC_CTRL1_LRADC_IRQ(0))
1153+
if (iio_buffer_enabled(iio)) {
1154+
if (reg & lradc->buffer_vchans)
1155+
iio_trigger_poll(iio->trig);
1156+
} else if (reg & LRADC_CTRL1_LRADC_IRQ(0)) {
11561157
complete(&lradc->completion);
1158+
}
11571159

11581160
mxs_lradc_reg_clear(lradc, reg & clr_irq, LRADC_CTRL1);
11591161

0 commit comments

Comments
 (0)