Linux driver for ad7888

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?

  • Hi,

    I moved this thread to the Linux Software Drivers community, someone here should be able to assist you.

    Regards,

    Karen

  • Hi,

    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.

    - Lars

  • Lars,

    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.

    thanks,

  • I see that it was you, Lars, that did the merge.  I am using your merged file.

  • Hi,

    Sorry for the delayed response. I've updated the file that fixes one potential crash source. Can you try again with the new patch?

    If it still crashes, please provide the full crash report from dmesg.

    - Lars