Skip to content

Commit 8ff837c

Browse files
committed
iio: buffer: Add industrialio-buffer-dmaengine-filtered
This is a hack to discard ADAQ4216 second channel data. The ad4630_fmc HDL project was designed for ADCs with two channels and always streams two data channels to DMA (even when the ADC has only one physical channel). Though, if the ADC has only one physical channel, the data that would come from the second ADC channel comes in as noise and has to be discarded. Because of that, only half of data collected by DMA blocks shall be passed to IIO buffers when using single-channel ADCs such as ADAQ4216. Because only half of the data pushed to DMA is used, the filtered dmaengine buffer variant allocates blocks that are two times the usual size so the IIO buffer can still be filled with the data from one DMA block. Otherwise, a data glitch occurs right in the middle of the IIO buffer. Add a separate dmaengine buffer variant for filtering data from ADAQ4216 and similar single-channel ADCs supported by the ad4630.c driver. Signed-off-by: Marcelo Schmitt <[email protected]>
1 parent 4be470b commit 8ff837c

File tree

4 files changed

+502
-0
lines changed

4 files changed

+502
-0
lines changed

drivers/iio/buffer/Kconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,19 @@ config IIO_BUFFER_DMAENGINE
3030

3131
Should be selected by drivers that want to use this functionality.
3232

33+
config IIO_BUFFER_DMAENGINE_FILTERED
34+
tristate "Industrial I/O DMA buffer integration with DMAEngine that filters data"
35+
select IIO_BUFFER_DMA
36+
select IIO_BUFFER_DMAENGINE
37+
help
38+
Provides a bonding of the generic IIO DMA buffer infrastructure with the
39+
DMAEngine framework. This can be used by converter drivers with a DMA port
40+
connected to an external DMA controller which is supported by the
41+
DMAEngine framework.
42+
43+
Should NOT be selected by anything, unless using ADAQ4216 or similar
44+
single-channel ADCs supported by the ad4630.c driver.
45+
3346
config IIO_DMA_BUF_MMAP_LEGACY
3447
bool "Enables I/O DMA buffer legacy MMAP support"
3548
depends on IIO_BUFFER_DMAENGINE

drivers/iio/buffer/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
obj-$(CONFIG_IIO_BUFFER_CB) += industrialio-buffer-cb.o
88
obj-$(CONFIG_IIO_BUFFER_DMA) += industrialio-buffer-dma.o
99
obj-$(CONFIG_IIO_BUFFER_DMAENGINE) += industrialio-buffer-dmaengine.o
10+
obj-$(CONFIG_IIO_BUFFER_DMAENGINE_FILTERED) += industrialio-buffer-dmaengine-filtered.o
1011
obj-$(CONFIG_IIO_BUFFER_HW_CONSUMER) += industrialio-hw-consumer.o
1112
obj-$(CONFIG_IIO_TRIGGERED_BUFFER) += industrialio-triggered-buffer.o
1213
obj-$(CONFIG_IIO_KFIFO_BUF) += kfifo_buf.o

0 commit comments

Comments
 (0)