I am using an AD9467 ADC with some DSP inside the PL part of a Zynq 7020. I have two DMA controllers feeding into the DDR and beeing read using libiio over Ethernet on another machine. For one of the channels I am using a custom IIO kernel driver to fake a ADC device and read the second DMA channel (as it is only a single ADC but two data streams). Now I would like to access the DMA buffer content of the first channel and derive a (low speed) value from the buffer and present this as a separate channel in the iio device. My approach would be to use a modified AD9467 kernel driver but to me it is not clear how to do this in a clean way. Do you have any suggestions?
If I understand it correctly the submit method defined in the iio_dma_buffer_ops could be used to access the buffer content before it is pushed to the queue again. Would it be possible to register a separate consumer?
Without looking at some code - but this sounds like something for the IIO in-kernel interface.
The in-kernel interface allows some other device to access samples from an IIO device.
With this you can implement let's say a input touch screen driver using ADCs from an IIO device.
I have not found any meaningful documentation on this topic. Could you point to documentation or an example?
What I am trying at the moment is to write a driver for a fake device which has an internal buffer and the device acts like beeing an ADC/DAC to the IIO system. I have a userspace application which uses libiio to pull the data from a real ADC and pushes the data as DAC data to the fake device driver. This driver is then performing the processing of the data which results in a much reduced data set (in the most extreme case only one sample) and provides this result acting as an ADC.
The reason why I am doing all of this is because I would like to use the libiio for my end-user application due to its convenience (providing a solid network context, usb context, etc. for IIO) and I already have a different device where I pass the data to a end-user system over the network using libiio and I would like to avoid mixing different usage types on the Zynq itself. If there is a good solution for data preprocessing in the IIO/libiio data path from the device to the consumer of the data I woud be happy for any best practice tips or tricks ;)