iMX287 LRADC giving intermittent 4095 (max) value

cancel
Showing results for 
Search instead for 
Did you mean: 

iMX287 LRADC giving intermittent 4095 (max) value

Jump to solution
269 Views
sam_jaeschke
Contributor II

I'm using Linux 4.8.17 from this commit: GitHub - Freescale/linux-fslc at 35ef7950aaf7caa28afae35160bda0734ecfeba7 

My device tree has this:

#include "imx28.dtsi"

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

When I read from LRADC channels 2 and 3, I get the value 4095 (maximum for 12-bits) at regular intervals. The timing does not even need to be regular to behave this way.

# cat /sys/devices/soc0/80000000.apb/80040000.apbx/80050000.lradc/iio\:device0/in_voltage2_raw
4095
# cat /sys/devices/soc0/80000000.apb/80040000.apbx/80050000.lradc/iio\:device0/in_voltage2_raw
2393
# cat /sys/devices/soc0/80000000.apb/80040000.apbx/80050000.lradc/iio\:device0/in_voltage2_raw
2413
# cat /sys/devices/soc0/80000000.apb/80040000.apbx/80050000.lradc/iio\:device0/in_voltage2_raw
2395
# cat /sys/devices/soc0/80000000.apb/80040000.apbx/80050000.lradc/iio\:device0/in_voltage2_raw
4095
# cat /sys/devices/soc0/80000000.apb/80040000.apbx/80050000.lradc/iio\:device0/in_voltage2_raw
2393
# cat /sys/devices/soc0/80000000.apb/80040000.apbx/80050000.lradc/iio\:device0/in_voltage2_raw
2411
# cat /sys/devices/soc0/80000000.apb/80040000.apbx/80050000.lradc/iio\:device0/in_voltage2_raw
2393
# cat /sys/devices/soc0/80000000.apb/80040000.apbx/80050000.lradc/iio\:device0/in_voltage2_raw
4095
# cat /sys/devices/soc0/80000000.apb/80040000.apbx/80050000.lradc/iio\:device0/in_voltage2_raw
2395
# cat /sys/devices/soc0/80000000.apb/80040000.apbx/80050000.lradc/iio\:device0/in_voltage2_raw
2413
# cat /sys/devices/soc0/80000000.apb/80040000.apbx/80050000.lradc/iio\:device0/in_voltage2_raw
2395
# cat /sys/devices/soc0/80000000.apb/80040000.apbx/80050000.lradc/iio\:device0/in_voltage2_raw
4095


# cat /sys/devices/soc0/80000000.apb/80040000.apbx/80050000.lradc/iio\:device0/in_voltage3_raw
4095
# cat /sys/devices/soc0/80000000.apb/80040000.apbx/80050000.lradc/iio\:device0/in_voltage3_raw
2413
# cat /sys/devices/soc0/80000000.apb/80040000.apbx/80050000.lradc/iio\:device0/in_voltage3_raw
4095
# cat /sys/devices/soc0/80000000.apb/80040000.apbx/80050000.lradc/iio\:device0/in_voltage3_raw
2413
# cat /sys/devices/soc0/80000000.apb/80040000.apbx/80050000.lradc/iio\:device0/in_voltage3_raw
4095
# cat /sys/devices/soc0/80000000.apb/80040000.apbx/80050000.lradc/iio\:device0/in_voltage3_raw
2411
# cat /sys/devices/soc0/80000000.apb/80040000.apbx/80050000.lradc/iio\:device0/in_voltage3_raw
4095
# cat /sys/devices/soc0/80000000.apb/80040000.apbx/80050000.lradc/iio\:device0/in_voltage3_raw
2413
# cat /sys/devices/soc0/80000000.apb/80040000.apbx/80050000.lradc/iio\:device0/in_voltage3_raw
4095
# cat /sys/devices/soc0/80000000.apb/80040000.apbx/80050000.lradc/iio\:device0/in_voltage3_raw
2413

There is no way the actual voltage is fluctuating at just the same time as the voltage gets read at irregular intervals.

Is this a problem that has been seen before? What could be going wrong?

Interestingly, channels 4-5 follow a pattern of going low (13-16) at regular intervals: Voltage, Voltage, 14, 16, Voltage, Voltage, 15, 13, Voltage, Voltage. That also seems odd.

Every other channel behaves fine.

Many thanks.

Labels (2)
0 Kudos
1 Solution
166 Views
sam_jaeschke
Contributor II

That was a bit silly....

I'm not using a touch screen, so I removed "fsl,lradc-touchscreen-wires = <4>;" from the device tree and it worked!

View solution in original post

0 Kudos
1 Reply
167 Views
sam_jaeschke
Contributor II

That was a bit silly....

I'm not using a touch screen, so I removed "fsl,lradc-touchscreen-wires = <4>;" from the device tree and it worked!

View solution in original post

0 Kudos