Porting of gt911 touch screen driver based on imx6

Reference: https://blog.csdn.net/zhuyuming/article/details/52652525?locationNum=3

    In fact, there is already a driver of goodix (drivers\input\touchscreen\goodix.c) in the Linux kernel source code downloaded from the Linux kernel official website (https://www.kernel.org/), and the of_device_id in the code shows the supported touch The chip seems to support gt911.

 

1. Add the file to the kernel  drivers\input\touchscreen\ folder, and modify the Makefile and Kconfig files:

Add on Makefile:


On kconfig add:


Note: Filter invalid interrupts in case of touch down.

    GT911 will have an invalid interrupt when touch down (perhaps goodix is ​​used to report other information). If this type of interrupt is not filtered, DOWN/UP events will be reported alternately when touch down, which is the imagination displayed on the UI. Will be touch valid swipe invalid. In addition, add a conditional judgment to the part of reporting the UP event, that is, touch_num==0 for this interruption && touch_num!=0 for the previous interruption.

The code modification is mainly as follows (add two lines of code):


2. Add a device node and set the corresponding I2C bus interface and interrupt pin


3. Recompile and compile the goodix.c file into the kernel

4. Make sure that the hardware connection is normal. After booting, you should be able to find the device node under /dev/input/


Using the evtest tool to test, you can generally achieve touch:   evtest /dev/input/event0 


Download the reference source code: https://download.csdn.net/download/hsl416604093/10397503

Passed the test on the imx6q platform.



Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325648966&siteId=291194637