AnsweredAssumed Answered

iMX287 LRADC giving intermittent 4095 (max) value

Question asked by Sam Jaeschke on Aug 20, 2018
Latest reply on Aug 20, 2018 by Sam Jaeschke

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.

Outcomes