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.

Linux/PROCESSOR-SDK-AM335X: Raw ADC value access from another driver

Part Number: PROCESSOR-SDK-AM335X

Tool/software: Linux

Hi,

I am working on BeagleBone Black rev C.
I am trying to make a custom character driver where I should be able to access the raw ADC values inside my character driver.
Currently, I am reading the raw adc values using sysio (/sys/bus/iio/devices/iio\:device0/in_voltage4_raw) in my driver, But I want a proper way of accessing the ADC raw values from driver level itself, so that I dont have to go to user space to read the values.
Assume ti_am335x_adc is already loaded in the Kernel.

Kindly provide me with a sample code or using any API showing the way to access the ADC Raw Values of a particular Channel directly in my Character Driver.

Regards
Moses Christopher