Goodix Touch driver problem

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Goodix Touch driver problem

Jump to solution
3,784 Views
Ahmet_Cihan_AKINCA
Contributor III

Hi.

I am attempting to integrate a Goodix touchscreen into my imx7dsabresd system. It works fine but after about 1 minutes from the opening. I have monitored the touch interrupt and i2c signals using an osciloscope. The chip generates the interrupt signal upon power-on, but I observe i2c signals after 1 minutes.

How can I fix this delay problem?

Kernel version is;

Linux imx7dsabresd 5.4.70-2.3.11+gb34a9c9644c1 #1 SMP PREEMPT Thu Jan 18 17:23:50 UTC 2024 armv7l armv7l armv7l GNU/Linux


Related part of my dts file is like that;

&i2c1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_i2c1>;
status = "okay";
clock-frequency = <100000>;
gt911@5d {
compatible = "goodix,gt911";
reg = <0x5d>;
interrupt-parent = <&gpio2>;
interrupts = <30 IRQ_TYPE_EDGE_FALLING>;    
        irq-gpios = <&gpio2 30 GPIO_ACTIVE_HIGH>;
        reset-gpios = <&gpio1 12 GPIO_ACTIVE_LOW>;
touchscreen-size-x = <1024>;
touchscreen-size-y = <600>;
touchscreen-inverted-x = <0>;
touchscreen-inverted-y = <0>;
};
};

 Dmesg is like that;

[1.521610] Goodix-TS 0-005d: probe
[1.521647] Goodix-TS 0-005d: 0-005d supply AVDD28 not found, using dummy regulator
[1.529432] Goodix-TS 0-005d: 0-005d supply VDDIO not found, using dummy regulator
[1.655325] Goodix-TS 0-005d: ID 911, version: 1060
[1.660320] Goodix-TS 0-005d: Direct firmware load for goodix_911_cfg.bin failed with error -2
[1.669108] i2c-core: driver [Goodix-TS] registered
[1.669410] Goodix-TS 0-005d: Falling back to sysfs fallback for: goodix_911_cfg.bin
[64.509368] input: Goodix Capacitive TouchScreen as /devices/soc0/soc/30800000.aips-bus/30a20000.i2c/i2c-0/0-005d/input/input1

 

Thanks in advance..

Labels (2)
Tags (1)
0 Kudos
1 Solution
3,695 Views
Ahmet_Cihan_AKINCA
Contributor III

I solved the problem. It's a driver-related issue, but it's something that exists in all drivers including the latest one. Probably this problem have ignored since nobody paid attention to the 64-second delay. However, for fast-opening devices it is important.

There is a section in the driver where it searches for the configuration file. If the configuration file is not found, it continues, but the part where the file is searched creates a time delay. In goodix.c file;

 

static int goodix_ts_probe(struct i2c_client *client,
   			const struct i2c_device_id *id)
{
    struct goodix_ts_data *ts;
    int error;
......
......
    if (ts->gpiod_int && ts->gpiod_rst) {
   	 /* update device config */
   	 ts->cfg_name = devm_kasprintf(&client->dev, GFP_KERNEL,
   				   	"goodix_%d_cfg.bin", ts->id);
   	 if (!ts->cfg_name)
   		 return -ENOMEM;
   	 error = request_firmware_nowait(THIS_MODULE, true, ts->cfg_name,
   					 &client->dev, GFP_KERNEL, ts,
   					 goodix_config_cb);
  	 if (error) {
   		 dev_err(&client->dev,
   			 "Failed to invoke firmware loader: %d\n",
   			 error);
   		 return error;
   	 }
   	 return 0;
    } 
    else {
   	 error = goodix_configure_dev(ts);
   	 if (error)
   		 return error;
    }
    return 0;
}

 

I just changed here..

 

 //if (ts->gpiod_int && ts->gpiod_rst) {
 if(0){

 

And the result;

 

[    1.490665] Goodix-TS 0-005d: probe
[    1.504725] Goodix-TS 0-005d: 0-005d supply AVDD28 not found, using dummy regulator
[    1.516019] Goodix-TS 0-005d: 0-005d supply VDDIO not found, using dummy regulator
[    1.651437] Goodix-TS 0-005d: ID 911, version: 1060
[    1.687225] input: Goodix Capacitive TouchScreen as /devices/soc0/soc/30800000.aips-bus/30a20000.i2c/i2c-0/0-005d/input/input0
[    1.702867] i2c-core: driver [Goodix-TS] registered

 

It finishes the job in 2 seconds..

View solution in original post

0 Kudos
4 Replies
3,696 Views
Ahmet_Cihan_AKINCA
Contributor III

I solved the problem. It's a driver-related issue, but it's something that exists in all drivers including the latest one. Probably this problem have ignored since nobody paid attention to the 64-second delay. However, for fast-opening devices it is important.

There is a section in the driver where it searches for the configuration file. If the configuration file is not found, it continues, but the part where the file is searched creates a time delay. In goodix.c file;

 

static int goodix_ts_probe(struct i2c_client *client,
   			const struct i2c_device_id *id)
{
    struct goodix_ts_data *ts;
    int error;
......
......
    if (ts->gpiod_int && ts->gpiod_rst) {
   	 /* update device config */
   	 ts->cfg_name = devm_kasprintf(&client->dev, GFP_KERNEL,
   				   	"goodix_%d_cfg.bin", ts->id);
   	 if (!ts->cfg_name)
   		 return -ENOMEM;
   	 error = request_firmware_nowait(THIS_MODULE, true, ts->cfg_name,
   					 &client->dev, GFP_KERNEL, ts,
   					 goodix_config_cb);
  	 if (error) {
   		 dev_err(&client->dev,
   			 "Failed to invoke firmware loader: %d\n",
   			 error);
   		 return error;
   	 }
   	 return 0;
    } 
    else {
   	 error = goodix_configure_dev(ts);
   	 if (error)
   		 return error;
    }
    return 0;
}

 

I just changed here..

 

 //if (ts->gpiod_int && ts->gpiod_rst) {
 if(0){

 

And the result;

 

[    1.490665] Goodix-TS 0-005d: probe
[    1.504725] Goodix-TS 0-005d: 0-005d supply AVDD28 not found, using dummy regulator
[    1.516019] Goodix-TS 0-005d: 0-005d supply VDDIO not found, using dummy regulator
[    1.651437] Goodix-TS 0-005d: ID 911, version: 1060
[    1.687225] input: Goodix Capacitive TouchScreen as /devices/soc0/soc/30800000.aips-bus/30a20000.i2c/i2c-0/0-005d/input/input0
[    1.702867] i2c-core: driver [Goodix-TS] registered

 

It finishes the job in 2 seconds..

0 Kudos
3,750 Views
Ahmet_Cihan_AKINCA
Contributor III

Any suggestions? I don't have goodix_911_cfg.bin.. Is it necessary? If necessary how can I create this file?

0 Kudos
3,732 Views
AldoG
NXP TechSupport
NXP TechSupport

Hello,

From the logs I see no error, when it fails loading the firmware It's a non-issue. It appears that the driver looks for a board-specific firmware blob (which doesn't exist). Also, if it was really needed it won't work later on.

 

Does it start working after it has fully booted?
Also, on the goodix driver I found the following:

https://github.com/nxp-imx/linux-imx/commit/68caf85881cd842b59d5e2124a236ecce0389a73

Best regards/Saludos,
Aldo.

0 Kudos
3,723 Views
Ahmet_Cihan_AKINCA
Contributor III

Thank you for you response AldoG..

Total boot duration is about 9 seconds. After boot, my application starts and it is seen on the screen immediately. Thus, it is a big problem for me since touch does not work for almost 40 seconds. Users of my device won't like such a delay.

My goodix.c file is not the same file that you addressed but I have inspected carefully line-by-line and I'm sure that there is no significant differences. My goodix.c file is attached, too.

However, I'm suspicious about reset-pin;

 

   	 reset-gpios = <&gpio1 12 GPIO_ACTIVE_HIGH>;

 

When I change this pin to ACTIVE_LOW, nothing changes on hardware. I check the reset pin via an oscilloscope and it still works as ACTIVE_HIGH. On the other hand, the touch does not work when I delete this line completely and this makes sense. Why can't I switch this pin as active low/high to check the situation?

I have also attached my device tree file. I would appreciate it if you check the my dts file.

Thank you AldoG..

0 Kudos