Resistive touchscreen calibration

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

Resistive touchscreen calibration

NXP Employee
NXP Employee



This post intends to present an overview of the touchscreen calibration process under Android.


Although for calibration to happen during first boot it's necessary to pass "calibration" argument to kernel, it's not at kernel level that calibration actually happens.


init process

In user space, init parses the kernel command line and if "calibration" argument is found, init sets Android's property ro.calibration to "1".

init source code can be found under system/core/init/init.c


init.rc file

After init process has properly set ro.calibration property, init.rc file calls the ts_calibrator program, which reads the property value. In case the value is "0", the program exits immediately. In case the value is "1", the program loads the configuration screen to capture 3 points.

Once the coordinates for the three points have been read, ts_calibrator stores the information inside /data/system/calibration and sets the same values to the touchscreen driver using its calibration interface available at /sys/module/mxc_ts/parameters/calibration.

After first boot, as /data/system/calibration is already there, ts_calibrator only loads its values to the driver, avoiding the calibration screen to be shown.

If a new calibration needs to be forced, it's only necessary to reboot the board after removing /data/system/calibration file.


Kernel level

At kernel level, the touchscreen driver implementation can be found at: kernel_imx/drivers/input/touchscreen/mxc_ts.c. This is the module that implements the interface found at /sys/module/mxc_ts/parameters/calibration and also the correction mechanism based on calibration parameters.

Labels (1)
0 Kudos
1 Reply

Contributor III

Hi Rogerio,

     We have met one issue about resistive touchscreen calibration issue on MX53 SMD board Android OS, the first poin appear, but system no respond when I touch the screen. do you know where happened issue?

     P.S,  using cat /dev/input , Android can recoginze the device name of da9052_tsi and event1, our PMIC is da9052,  the first poin appear, but system can execute when I touch the screen



0 Kudos