Skip to content

Commit c4ecff9

Browse files
ehristevgregkh
authored andcommitted
iio: adc: at91: fix acking DRDY irq on simple conversions
commit bc1b453 upstream. When doing simple conversions, the driver did not acknowledge the DRDY irq. If this irq status is not acked, it will be left pending, and as soon as a trigger is enabled, the irq handler will be called, it doesn't know why this status has occurred because no channel is pending, and then it will go int a irq loop and board will hang. To avoid this situation, read the LCDR after a raw conversion is done. Fixes: 0e589d5 ("ARM: AT91: IIO: Add AT91 ADC driver.") Cc: Maxime Ripard <[email protected]> Signed-off-by: Eugen Hristev <[email protected]> Acked-by: Ludovic Desroches <[email protected]> Cc: <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 39b6d86 commit c4ecff9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/iio/adc/at91_adc.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,8 @@ static void handle_adc_eoc_trigger(int irq, struct iio_dev *idev)
279279
iio_trigger_poll(idev->trig);
280280
} else {
281281
st->last_value = at91_adc_readl(st, AT91_ADC_CHAN(st, st->chnb));
282+
/* Needed to ACK the DRDY interruption */
283+
at91_adc_readl(st, AT91_ADC_LCDR);
282284
st->done = true;
283285
wake_up_interruptible(&st->wq_data_avail);
284286
}

0 commit comments

Comments
 (0)