Access internal ADC of AR7 on legato

Hi, I am wondering how to use the 2 ADCs of the AR7 on the legato plateform, or at least one of them.

For the GPIOs it looks that one can use things like:

int fd;
char buf[MAX_BUF]; 
int gpio = XX;
fd = open("/sys/class/gpio/export", O_WRONLY);
sprintf(buf, "%d", gpio); 
write(fd, buf, strlen(buf));

But for ADCs? Do we have to change the kernel? I am lost.

Thank you.


External ADC pins (ADC1 and ADC2) are not yet readable from Linux sysfs (hopefully it should be supported in the coming releases).

Currently it is only possible to read some internal ADC functions (voltage, temperature) from “/sys/bus/platform/devices/pm8xxx-adc/”.

It is still possible to read ADC1 and ADC2 pins from external AT port (USB or UART) using the following AT commands:
ADC1AT!MADC?5 !MADC: <value> OKADC2AT!MADC?6 !MADC: <value> OK


Thank you.