I see there is linux kernel driver support for the ad7887, but the very similar ad7888 does not seem to have a driver anywhere. Can I use the same driver? Can I read all 8 channels using this driver, since the 7887 is only a 2 channel device?
I created a driver for the ad7888 a while ago, unfortunately never had the chance to properly test it, but I think it should work. I've pushed the driver to the iio-ad7888 branch on the ADI linux repository. You can find the patch that adds support for the ad7888 to the ad7887 here.
Let me know if it works.
Thanks for the updated code. I see that someone has merged this patch into the git repo that was referenced. I am compiling this on Marvel ARM (Armada). Upon using the new kernel, this driver seems to load fine and creates a series of file handles in /sys/class/spi_master/spi1/spi1.1/iio\:device0/ :
buffer in_voltage2_raw in_voltage6_raw power uevent
dev in_voltage3_raw in_voltage7_raw scan_elements
in_voltage0_raw in_voltage4_raw in_voltage_scale subsystem
in_voltage1_raw in_voltage5_raw name trigger
but when I try to cat a voltage reading, it crashes the OS or throws a segmentation fault. Note I am using the ad7887.c file and not your patch. Anyone have a theory as to why this would happen? I am using a Marvell based uboot and a 3.16 kernel. the old driver worked ok for the first channel with this setup.