[beagleboard] Re: BeagleBone Black Analog Input

I missed this post before I made mine about the same thing. I've tried
several things without any luck. Bonescript can read the analog inputs and
its index.js seems to say its in /sys/bus/platform/devices/tsc/ain But I
haven't had luck there either.

Bonescript only reads there with the 3.2 kernel. For the new kernel, it does:
echo cape-bone-iio > /sys/devices/bone_capemgr.*/slots
cat /sys/module/bone_iio_helper/drivers/platform:bone-iio-helper*/AIN*

Thanks! I can get to it now with:

echo cape-bone-iio > /sys/devices/bone_capemgr.8/slots
cat /sys/module/bone_iio_helper/drivers/platform:bone-iio-helper/helper.13/AIN1

1409

Where do the 8 and 13 come from and do they change regularly? And for future reference where is this sort of thing documented?

Thanks! I can get to it now with:

echo cape-bone-iio > /sys/devices/bone_capemgr.8/slots
cat
/sys/module/bone_iio_helper/drivers/platform:bone-iio-helper/helper.13/AIN1

1409

Where do the 8 and 13 come from and do they change regularly?

I don't know. They won't change regularly, but they can change. They
are some kind of instance IDs.

And for future
reference where is this sort of thing documented?

The kernel documentation for devicetree [1] is a start, but you have
to dig through the patches applied by Koen [2] to get some specifics.
Looking at the examples on an already patched tree [3,4] is the most
practical way to learn about the BeagleBone devicetree support and the
various helper drivers created to simplify peripheral access.

Unfortunately, much of the documentation is getting started right-here
and right-now as part of these e-mail chains that folks can search for
later.

I did make a stab at documenting some aspects of this in a book [5],
but honestly it isn't really complete in the sense of a user manual or
anything like that. I'm going to work with Gerald to contribute some
software documentation into the System Reference Manual and continue
to flesh out the Bonescript examples as well, so that's where you
should ultimately look for it (SRM + bone101), but I'm looking for
various upstream contributions to help see this stuff solidify.

[1] /Documentation/devicetree/
[2] GitHub - beagleboard/kernel at 3.8
[3] linux/firmware/capes at 3.8-for-panto-rebase · koenkooi/linux · GitHub
[4] linux/arch/arm/boot/dts at 3.8-for-panto-rebase · koenkooi/linux · GitHub
[5] http://bit.ly/18lWFwA

Thanks for the info!

I see a variation on the above with kernel 3.8.11. After doing

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

I can cat that file and this is what it shows:

root@beaglebone:/sys/module# cat /sys/devices/bone_capemgr.8/slots
0: 54:PF—
1: 55:PF—
2: 56:PF—
3: 57:PF—
5: ff:P-O-L Bone-Black-HDMI,00A0,Texas Instrument,BB-BONELT-HDMI
6: ff:P-O-L Override Board Name,00A0,Override Manuf,cape-bone-iio

However, I do not have a /sys/module/bone_iio_helper.

Instead, I can find my AIN devices under
/sys/bus/platform/drivers/bone-iio-helper/helper*

doing a cat on the AIN* devices gives me some numbers.

Hope this helps someone.