I've been struggling to understand the right approach for implementing triggered capture of data from the AD9467, where the trigger is an interrupt handler (from a separate device). I've been looking through the IIO framework, driver source, and other forum posts, but I'm still confused as to how this is supposed to be done. Here's what I'm looking to do:
- Upon firing of my interrupt handler, immediately trigger capture samples over some time interval (e.g. 10 usec).
- Ship those samples off to userland for further processing
It seems like the general approach would be to leverage the IIO in kernel consumer interfaces, and get the channel via iio_channel_get(), and then from there setup a triggered buffer setup similar to what iio_triggered_buffer_setup() does, but it seems like the existing cf_axi_adc IIO driver has already setup some, but not all of what I would need (e.g. from the iio_dev I see the buffer exists, but the pollfunc doesn't), and the block comment for that routine says that should be invoked prior to iio_device_register(), which cf_axi_adc has already done.
I also tried leveraging the iio_channel_*_all_cb() routines, but found iio_channel_start_all_cb() wouldn't succeed due to iio_update_buffers() not succeeding. Perhaps I'm missing some steps here.
What is the best way to approach what I'm trying to do? Any references to suggest?