###Enabling ADC (AIN0 - AIN6) on BBB for newer Linux kernels that do not support device tree overlays
The device tree overlay mechanism has been abandoned in newer (3.9+?) linux kernels. Access to GPIO pins via the filesystem-based /sys/class/gpio is still supported, but for some reason the default device tree source (dts) for the Beaglebone Black does not define the 7 ADC ports as accessible (not sure why this is—I don't believe those pins can be used for anything else). If you don't have any devices listed under /sys/bus/iio/devices
, then you too are suffering. Read on.
Thanks to Matti Laakso for pointing me in the right direction here
The fix is to add the definition of the ADC ports to the dtb file that is loaded at boot time. For the Beaglebone Black, the default loaded dtb is am335x-boneblack.dtb
and the boot loader looks for it in directory /boot/dtbs
.
Note: my environment is ArchLin