This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM3352: Cannot read ADC in continuous mode

Part Number: AM3352

Hi,

I reference the Docs and ADC Driver's Guide to run ADC in continue mode. However, I can't find "/dev/iio:device0".

Our goal is to read ADC value every 10us in C.

===========================Log start==============================================

/ # ls -l /sys/bus/iio/devices/iio\:device0/buffer/
total 0
-rw-r--r-- 1 root 0 4096 Jan 1 01:36 enable
-rw-r--r-- 1 root 0 4096 Jan 1 01:36 length
-rw-r--r-- 1 root 0 4096 Jan 1 01:36 watermark
/ # ls -al /sys/bus/iio/devices/iio\:device0/scan_elements/
total 0
drwxr-xr-x 2 root 0 0 Jan 1 01:37 .
drwxr-xr-x 5 root 0 0 Jan 1 01:36 ..
-rw-r--r-- 1 root 0 4096 Jan 1 01:37 in_voltage0_en
-r--r--r-- 1 root 0 4096 Jan 1 01:37 in_voltage0_index
-r--r--r-- 1 root 0 4096 Jan 1 01:37 in_voltage0_type
/ # cat /sys/bus/iio/devices/iio\:device0/scan_elements/in_voltage0_type
le:u12/16>>0
/ # echo 1 > /sys/bus/iio/devices/iio\:device0/scan_elements/in_voltage0_en
/ # echo 100 > /sys/bus/iio/devices/iio\:device0/buffer/length
/ # echo 1 > /sys/bus/iio/devices/iio\:device0/buffer/enable

/ # /mnt/iio_generic_buffer -N 0 -g
iio device number being used is 0
trigger-less mode selected
Failed to open /dev/iio:device0

/ # cat /sys/bus/iio/devices/iio\:device0/in_voltage0_raw
cat: read error: Device or resource busy
/ # echo 0 > /sys/bus/iio/devices/iio\:device0/buffer/enable
/ # cat /sys/bus/iio/devices/iio\:device0/in_voltage0_raw
1656

===========================Log end===============================================

SDK Version: 04.02.00.09

Kernel version: Linux liteon 4.9.59 #153 PREEMPT Wed Mar 11 08:58:57 CST 2020 armv7l GNU/Linux

DTS:

&tscadc {
status = "okay";

adc {
ti,adc-channels = <0>;
ti,chan-step-opendelay = <0x0>;
ti,chan-step-sampledelay = <0x1>;
ti,chan-step-avg = <0>;
};
};

Thanks