Knowledge Base

Content

Debugging Touchscreen

To debug touchscreen driver, go to:

# cd
# sudo gedit /ltib/rpm/BUILD/imx6rex-linux-3.0.35/drivers/input/touchscreen/tsc2007.c

If you would like to print a message from the driver, here is an example, just add this line and change the text between “”:

dev_err(&ts->client->dev, "tc.x = %4u / tc.y = %4u / rt = %4u\n", tc.x, tc.y, rt);

Useful links:
- How I2C communication should look (Page 9): http://www.ti.com/lit/an/slaa359/slaa359.pdf
- How PENIRQ works: http://www.ti.com/lit/an/slyt291/slyt291.pdf

Debug outputs
This is what we were getting:

Touchscreen WORKING correctly:

tsc2007 1-0048: tc.x = 2448 / tc.y = 2434 / rt =  411
tsc2007 1-0048: tc.x = 2450 / tc.y = 2436 / rt =  414
tsc2007 1-0048: tc.x = 2451 / tc.y = 2432 / rt =  434
tsc2007 1-0048: tc.x =    0 / tc.y = 4095 / rt =    0

Touchscreen NOT WORKING correctly (jumping to a corner):

tsc2007 1-0048: tc.x = 1471 / tc.y = 2305 / rt =  431
tsc2007 1-0048: tc.x = 1474 / tc.y = 2303 / rt =  446
tsc2007 1-0048: tc.x = 1471 / tc.y = 2302 / rt =  680
tsc2007 1-0048: tc.x =    3 / tc.y = 4095 / rt =  150 //BAD!
tsc2007 1-0048: tc.x =    0 / tc.y = 4095 / rt =    0

The BAD! line means, that when I released pen, touchscreen suddenly detected position x=3, y=4095 and jumped there!