how do I enable LRADC 0 in the i.MX28? I have the driver built into the kernel but I do not see the ii0 device

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

how do I enable LRADC 0 in the i.MX28? I have the driver built into the kernel but I do not see the ii0 device

Jump to solution
4,483 Views
tylerarnold
Contributor II

I am trying to use the LRADC channel 0  on a Linux system using the i.MX28. I have the LRAD driver enabled in the kernel config and confirmed it in the modules.builtin. However when I look at the /sys/bus/iio/devices I do not see any devices. What additional configuration do I have to do to get the channel to work? Do I need to add the channels to the DTB ? I suspect so.

thanks!

-Tyler

Labels (2)
1 Solution
3,817 Views
fabio_estevam
NXP Employee
NXP Employee

On imx28-evk.dts we use the LRADC to provide touchscreen functionality:

   lradc@80050000 {
   fsl,lradc-touchscreen-wires = <4>;
   status = "okay";
   fsl,lradc-touchscreen-wires = <4>;
   fsl,ave-ctrl = <4>;
   fsl,ave-delay = <2>;
   fsl,settling = <10>;
   };

View solution in original post

0 Kudos
Reply
10 Replies
3,817 Views
fabio_estevam
NXP Employee
NXP Employee

On my mx28evk I can read the voltages like this:

root@freescale /$ cat /sys/bus/iio/devices/iio:device0/in_voltage0_raw    

4095 

You can look at the imx28-evk.dts as a reference.

0 Kudos
Reply
3,815 Views
tylerarnold
Contributor II

yeah I have nothing there, and my dts is modeled after the imx28-evk and is pretty similar. I will double check everything though.

0 Kudos
Reply
3,818 Views
fabio_estevam
NXP Employee
NXP Employee

On imx28-evk.dts we use the LRADC to provide touchscreen functionality:

   lradc@80050000 {
   fsl,lradc-touchscreen-wires = <4>;
   status = "okay";
   fsl,lradc-touchscreen-wires = <4>;
   fsl,ave-ctrl = <4>;
   fsl,ave-delay = <2>;
   fsl,settling = <10>;
   };
0 Kudos
Reply
3,815 Views
tylerarnold
Contributor II

is that DTS the one your board is actually using? I am looking at mxs-lradc.txt and it suggests entries like:

lradc@80050000 {

                compatible = "fsl,imx28-lradc";

                reg = <0x80050000 0x2000>;

                interrupts = <10 14 15 16 17 18 19 20 21 22 23 24 25>;

                status = "okay";

                fsl,lradc-touchscreen-wires = <5>;

                fsl,ave-ctrl = <4>;

                fsl,ave-delay = <2>;

                fsl,settling = <10>;

        };

the reg and interrupts are missing.

0 Kudos
Reply
3,815 Views
fabio_estevam
NXP Employee
NXP Employee

reg and interrupts are inside imx28.dtsi, which is included by imx28-evk.dts.

3,815 Views
tylerarnold
Contributor II

yes, my lradc entry is identical.

0 Kudos
Reply
3,815 Views
tylerarnold
Contributor II

what kernel version are you building for? (I have 3.10.20 running)

0 Kudos
Reply
3,815 Views
fabio_estevam
NXP Employee
NXP Employee

I tried 3.18-rc5.

0 Kudos
Reply
3,815 Views
tylerarnold
Contributor II

my uboot environment was crusty/old, it was point at an old dtb which had the lrad registers disabled. I updated it to point to the new one I thought it was already using and channel 0 appears. Thanks for your help!

# cat /sys/bus/iio/devices/iio:device0/in_voltage0_raw

3393

/ # cat /sys/bus/iio/devices/iio:device0/in_voltage0_raw

3397

/ # cat /sys/bus/iio/devices/iio:device0/in_voltage0_raw

3398

/ # cat /sys/bus/iio/devices/iio:device0/in_voltage0_raw

3397

/ # cat /sys/bus/iio/devices/iio:device0/in_voltage0_raw

3399

/ # cat /sys/bus/iio/devices/iio:device0/in_voltage0_raw

3400

/ # cat /sys/bus/iio/devices/iio:device0/in_voltage0_raw

3395

/ # cat /sys/bus/iio/devices/iio:device0/in_voltage0_raw

3394

/ # cat /sys/bus/iio/devices/iio:device0/in_voltage0_raw

3394

/ # cat /sys/bus/iio/devices/iio:device0/in_voltage0_raw

3395

0 Kudos
Reply
3,815 Views
fabio_estevam
NXP Employee
NXP Employee

Great! Please mark the answer as 'useful' or 'correct' then.

0 Kudos
Reply