I'm using Yocto to build for BeagleBone Black, using the linux-ti-staging kernel, branch ti-linux-3.14.y, using the meta-ti layer.
I'd like to use several ADC channels, so I've configured as follows in the device tree:
&tscadc { status = "okay"; adc { ti,adc-channels = <0 1 4 6 7>; }; };
If I just read a single ADC channel, then everything works okay. So this is fine:
while true; do echo ----; cat /sys/bus/iio/devices/iio\:device0/in_voltage4_raw; done
But, if I try to read multiple channels, then it quickly locks up. This locks up:
while true; do echo ----; cat /sys/bus/iio/devices/iio\:device0/in_voltage*_raw; done
It typically runs just for a brief time such as 1 second or less, then halts. It's not a system crash, but the process is stuck in the "uninterruptible wait" state according to ps.
I looked at the ti_am335x_adc.c driver, and thought it could do with a mutex to protect most of the code in tiadc_read_raw(). I tried adding a mutex, but that didn't help.
Looking in ti_am335x_tscadc.c, I suspect it would be locking up in am335x_tscadc_need_adc().
Can anyone confirm this behaviour and propose a fix?