IIO Buffered Interface and AD5360


I am using the mainline AD5360 driver on a raspberry pi-class style board. It appears to function fine using the iio sysfs interface. I have read through the driver and noticed that it appears the buffered interface (iio_buffer and friends) is not supported (iio_buffer_create fails, no scan channels). 

What is the recommended way to efficiently write to all 16 channels on this device from user space? 

I am an experienced kernel developer but do not have familiarity with the IIO subsystem. How would I go about adding IIO buffered support to this driver, and would it improve performance?

Should I just be using iio_channel_attr_write_* and friends in a big loop?

Or should I be using the char device in /dev? What is the interface to that?


  • 0
    •  Analog Employees 
    on Oct 24, 2018 5:26 PM

    If that driver doesn't have any scan elements, then yes just looping over the attributes to get data is your only option. Read out the scale values first, since they won't change, and apply them to the outputs so the read values are in scientific units.

    Use the iio_channel_attr_read_* functions to do this, which completely replaces the sys fs interface.