Where did /sys/bus/iio/devices/iio\:device0/in_voltage[0-3]_raw go in saucy 3.13.X kernels?

Starting with a brand-new, out of the box BBB, I flashed it with https://rcn-ee.net/deb/flasher/saucy/BBB-eMMC-flasher-ubuntu-13.10-2014-03-27-2gb.img.xz which is of course the 3.8.13-bone40 kernel. The analog inputs were enabled once the

echo cape-bone-iio > /sys/devices/bone_capemgr.*/slots

command was given. The raw analog inputs were then readable at /sys/bus/iio/devices/iio:device0/in_voltage[0-7]_raw. However, after reading the inputs over a period of time, I started seeing errors reading the inputs, the “Resource temporarily unavailable” others have reported. Know the support for iio was updated in later kernels. I decided to update the kernel to see if that made a difference.

Using the update script at https://rcn-ee.net/deb/saucy-armhf/v3.13.8-bone8/install-me.sh, I updated to the latest pre-built kernel. Now, I see analog inputs with no additional prodding required (perhaps the magic is now buried in the boot sequence?), but I don’t see all the inputs, just 3: **/sys/bus/iio/devices/iio:device0/**in_voltage[4-6]_raw.

What am I missing? Is there something I need to enable/disable in the /boot/uboot/uEnv.txt?

Thanks.

– jda

As far as I know, the default am33x-boneblack.dtb which is read from kernel during boot does have only 3 pin addresses for analog inputs, you can modify this by referring TRM or other dts files. I do not have my file now sorry, I cannot post here.

Thanks. I was able to use the device tree compiler to make the analog inputs available. I started with:

ubuntu@arm:~$ ls /sys/bus/iio/devices/iio\:device0
buffer in_voltage4_raw in_voltage6_raw power subsystem
dev in_voltage5_raw name scan_elements uevent

The commands I used to add analog inputs 0-3 are:

$ sudo apt-get install device-tree-compiler
$ sudo dtc -I dtb -O dts /boot/uboot/dtbs/am335x-boneblack.dtb > am335x-boneblack.dts

Change the section:

adc {
          #io-channel-cells = <0x1>;
          compatible = "ti,am3359-adc";
          ti,adc-channels = <0x4 0x5 0x6>;
};

to

adc {
          #io-channel-cells = <0x1>;
          compatible = "ti,am3359-adc";
          ti,adc-channels = <0x0 0x1 0x2 0x3 0x4 0x5 0x6>;
};

then recompile, install and reboot:

$ dtc -O dtb -o am335x-boneblack.dtb am335x-boneblack.dts
$ sudo cp am335x-boneblack.dtb /boot/uboot/dtbs

Once rebooted, the devices show up:

ubuntu@arm:~$ ls /sys/bus/iio/devices/iio\:device0
buffer in_voltage0_raw in_voltage2_raw in_voltage4_raw in_voltage6_raw power subsystem
dev in_voltage1_raw in_voltage3_raw in_voltage5_raw name scan_elements uevent
ubuntu@arm:~$

-- jda