Touch Screen Calibration Values. How is this done in Android / Kernel?

I port Android Gingerbread to my custom board (with Samsung S5PV210 processor). I have a touch screen with an ESC7000 chip. I found the driver in /kernel/drivers/input/touchscreen/usbtouchscreen.c. It almost worked, but the order of the bits, the order and the byte order were not very good in USB packets. I changed the code to get the correct RAW position (I use printk on the console to see it), and now it almost works. My data ranges from xmin, ymin to xmax, ymax - from 420 430 to 3650, 3650, whereas in theory this should be from 0.0 to 4095.4095. This is not surprising, since capacitive sensing requires calibration. This is a simple calibration, such as y = mx + b for each axis (simple linear calibration). I looked around the drivers, and I canโ€™t understand where the calibration is done. It must be programmed because it is device dependent and must be calibrated for each device once during the production of the system. I want to make it clean, like other Android devices. Does anyone know where calibration information is stored in the Android system? Where is the code that calculates the compensation. Any web search about this gives information about people who want to recalibrate their phone. So it is useless to me.

+4
source share
1 answer

Take a look at the following thread: https://groups.google.com/forum/#!msg/rowboat/jlbwnmCIDg0/makHFil31pQJ

In EVM, we transfer calibrated values โ€‹โ€‹(or, say, hard-set values โ€‹โ€‹for Xmin / max, Ymin / max and XY resolution) from the driver to the user space.
...

Here the raw events frameworks/base/libs/ui/InputReader.cpp

SingleTouchInputMapper::process(const RawEvent* rawEvent) will handle raw events for a one-touch device. ABS_X and ABS_Y - the values โ€‹โ€‹are transmitted from the driver, and these are the absolute coordinates in ours, as I told you in my previous mail.

Correct me if I am wrong, Android Android phones do not have a mechanism for working calibration from user space. This is a kind of standard for Android phones to send calibrated values โ€‹โ€‹from the driver itself.

What I suggest, use tslib for calibration and let it save the values โ€‹โ€‹in / etc / pointercal. In SingleTouchInputMapper::sync(nsecs_t when) calculate the absolute coordinates by analyzing the values โ€‹โ€‹from the / etc / pointercal file.

+3
source

All Articles