Query on IIO consumer driver and device tree

sanchayan maity victorascroft at gmail.com
Sat Sep 27 02:54:35 EDT 2014


Hello,

There is an ADC driver following the IIO framework. I am using Kernel
3.17 rc5 in an embedded device. I am in the process of writing a
"consumer" IIO touchscreen driver which uses the ADC channels.

http://lxr.free-electrons.com/source/Documentation/devicetree/bindings/iio/iio-bindings.txt

I am following this document and my device tree node is as follows for
the touchscreen driver.

vf_touchctrl {
        compatible = "vf-touch";
        io-channels = "&adc0 0", &adc0 1",
                             "&adc1 0", "&adc1 2";
        pinctrl-names = "idle", "default";
        pinctrl-0 = "&pinctrl_default";
        pinctrl-1 = "&pinctrl_idle";
        gpio-xp = "&gpio0 8 0"
        .... /* Few more gpio entries like this */
};

In the touchscreen driver, i will be using the IIO consumer functions
from http://lxr.free-electrons.com/source/include/linux/iio/consumer.h.
When i call iio_channel_get_all(), i am expecting to get pointers to
the four channels in order specified in the DT above. Is my
understanding correct? Then specify these four channel pointers with
iio_read_channel_raw() to get the ADC readings.

My other question is related to the GPIO entry in the DT above. When
using of_get_named_gpio(), i do it like below.

int ret = of_get_named_gpio(node, "gpio-xp", 0);

I do not get the correct values, but negative error values. Also, i
can see a "argument longer than property" error for the device tree
parsing in dmesg log. Can someone point out what i am doing wrong
here?

Thanks & Regards,
Victor aka Sanchayan.



More information about the Kernelnewbies mailing list