[Beijing Xunwei] i.MX6ULL Terminator Linux capacitive touch screen experiment uses the ft5426 driver that comes with the Linux kernel

Many capacitive touch chip drivers are integrated in the Linux kernel, including the ft5426 ​​driver we use. So let's use the ft5426 ​​driver file that comes with the Linux kernel. Before using, you need to remove the ft5426.c driver file we added earlier, just modify the driver/input/touchscreen/Makefile file, and delete the following line:
obj-y += ft54266.o
The driver file of ft5426 ​​that comes with the kernel is drivers /input/touchscreen/edt-ft5x06.c.
1. Enable the kernel ft5426 ​​driver configuration
To use the driver that comes with the Linux kernel, you need to add the Linux kernel configuration. First open the graphical configuration interface, the command is as follows: the
make ARCH=arm menuconfig
configuration path is as follows:

Device Drivers  --->
Input device support  --->
[*]   Touchscreens  --->
<*>   EDT FocalTech FT5x06 I2C Touchscreen support

The configuration is shown in Figure 1:
Insert picture description here

figure 1

After the configuration is complete, recompile the Linux kernel to generate a zImage image.
2. Modify the device tree file
We need to modify the compatible attribute value of the ft5426 ​​device node under the device tree according to the compatible attribute in the edt-ft5x06.c file. The compatible attribute list supported by edt-ft5x06.c is as follows:

static const struct of_device_id edt_ft5x06_of_match[] = {
    
     
{
    
     .compatible = "edt,edt-ft5206", }, 
{
    
     .compatible = "edt,edt-ft5306", }, 
{
    
     .compatible = "edt,edt-ft5406", }, 
{
    
     /* sentinel */ } 
}; 

It can be seen that the default compatible properties supported by the edt-ft5x06.c file are as long as three "edt,edt-ft5206", "edt,edt-ft5306" and "edt,edt-ft5406". We can modify the ft5426 ​​node in the device tree, add a "edt, edt-ft5406" to the compatible attribute value, or add an item in the edt_ft5x06_of_match table in the edt-ft5x06.c file:
{ .compatible = "edt,edt-ft5426", }
In short, let ft5426 ​​be the device It matches with edt-ft5x06.c. Here we modify the ft5426 ​​device node under the device tree, as shown below after modification;

1 ft5426: ft5426@38 {
    
     
2  compatible = "edt,edt-ft5426","edt,edt-ft5406"; 
3  reg = <0x38>; 
4  pinctrl-names = "default";
5  pinctrl-0 = <&pinctrl_tsc>; 
6  interrupt-parent = <&gpio1>; 
7    interrupts = <9 0>; 
8  reset-gpios = <&gpio5 9 GPIO_ACTIVE_LOW>; 
9    interrupt-gpios = <&gpio1 9 GPIO_ACTIVE_LOW>; 
10 }; 

Add the "edt,edt-ft5406" compatible value to the compatible property.
After modifying the device tree, recompile. Then use the new zImage and dtb device tree files to start the development board. When the driver is normal, the startup information is as follows:
Insert picture description here

figure 2

Then you can use the following command to view the specific situation of the input device: the
cat /proc/bus/input/devices
result is shown in Figure 3:
Insert picture description here

image 3

Then you can use hexdump or ts_test_mt command to test.

Insert picture description here

Guess you like

Origin blog.csdn.net/BeiJingXunWei/article/details/112857761