NOTICE: The Processors Wiki will End-of-Life in December of 2020. It is recommended to download any files or other content you may need that are hosted on The site is now set to read only.

Capacitive touch integration with android

From Texas Instruments Wiki
Jump to: navigation, search

Content is no longer maintained and is being kept for reference only!

Capacitive touch integration with Android - Flow & Trap


Today more and more different fields are adopting touch screen or touch panels for application with human/machinery or human/computer interfaces. There are two types of touch panels are popular now a days.

  • Resistive touch
  • Capacitive touch

Resistive touch is simple, cheaper and easy to integrate. However with this touch level of calibration is required to be in place. There are various calibration algorithms available which can be use for this purpose.

Capacitive touch on other side has multi touch support and less prone to dust particle. Most capacitive touch controller has capability to support multiple configuration (x & y axis). According to configuration set for the touch one has to scale the inputs received from touch to the area of LCD. Kindly refer below figure.


As mentioned in above figure if touch screen having the same resolution as LCD on which it is mounted on then there is no question of scaling, but calibration might require to remove mechanical alignment error if introduce while mounting.

But as seen in second figure, where touch resolution is different than that of LCD’s. In such case every inputs coming from touch panel/screen has to be scaled or mapped to LCD’s visible resolution.

During integration phase, came across the problem - even after getting scaled input from touch driver, android screen does not show correct behavior. Very first thing of suspect is calibration issue, but after debugging and looking at the co-ordinate’s values from touch driver, found that values are getting re-scaled again at somewhere. To understand the cause; this document will briefly highlight on - input flow with respect to kernel and android interface and give solution for problem statement.

Touch Event Flow in brief

Below diagram explains top to bottom flow of touch event. Diagram has taken from the link {}.


Where does android do scaling?

Linux driver reports x and y axis’s information to input subsystem


Android’s input layer read axis’s information


Android’s input layer scale co-ordinates before dispatch to window manager


Problem Statement

At time it happens that

  • Inside touch driver, function configures touch screen to get input based on lcd screen’s x & y parameters.
  • Also in other case; touch driver its self does the scaling of touch co-ordinates to lcd screen area.

In both case mentioned above, android layer has to be aware of this or else it will proceed with scaling based on axis information.


To avoid mentioned problem, driver has to report axis’s information based on behavior. Ex. If driver configures touch screen to get 800x480 inputs for LCD 800x480 ( on which it is mounted on), then in probe function it has to be changed to 800x480 instead of maximum value. Or else put the value that has been defined in board file.



Technical Support and Product Updates

For further information or to report any problems, contact or
For community support join
For IRC #rowboat on