Sample Header Ad - 728x90

Wakeup from touchscreen does NOT work in embedded Linux

1 vote
0 answers
200 views
I am working on an embedded Linux (kernel-5.10.24) and there is a GT911 based touchscreen. The touchscreen is working well now. Then I tried to test the suspend/resume in this system. There is an RTC which is configured to wake up system in 120 seconds, and it also worked well, the touchscreen is also black in suspend and back to work after resume. Currently, I want to wake up system with screen touching but failed. I found the device tree does NOT enable slide-wake feature, so I changed the dts as follows,
goodix,slide-wakeup = ;
And I can see wakeup is enabled from kernel log.
goodix-ts 0-0004: slide-wakeup enabled
goodix-ts 0-0004: INT num 36, trigger type:2
goodix-ts 0-0004: slide wakeup enabled
I can see /sys/class/wakeup/* showed the name about gt9xx. When I put system into suspend mode, I still cannot wake up system by touching the screen. I am not very familiar with Linux suspend/resume architecture, I am wondering what is necessary to wake up system from a touchscreen. The gt9xx code is from https://github.com/goodix/gt9xx_driver_android/blob/master/gt9xx.c It has functions as follows,
static int gtp_wakeup_sleep(struct goodix_ts_data *ts)
{
	u8 retry = 0;
	int ret = -1;

	while (retry++ client);
		if (!ret) {
			dev_dbg(&ts->client->dev, "Success wakeup sleep\n");

			gtp_int_sync(ts, 25);
			if (ts->pdata->esd_protect)
				gtp_init_ext_watchdog(ts->client);

			return ret;
		}
		gtp_reset_guitar(ts->client, 20);
	}

	dev_err(&ts->client->dev, "Failed wakeup from sleep mode\n");
	return -EINVAL;
}
And in gtp_probe() it does followings to setup wakeup.
gtp_work_control_enable(ts, false);
	if (ts->pdata->slide_wakeup) {
		dev_info(&client->dev, "slide wakeup enabled\n");
		ret = enable_irq_wake(client->irq);
		if (ret dev, "Failed set irq wake\n");
	}
To test the codes, I did followings, echo standby > /sys/power/state. The system is suspended. I touched the screen (point and slide), to wake up system, but failed. The system is woken up after 120 seconds by RTC alarm timer.
Asked by wangt13 (631 rep)
May 25, 2023, 06:22 AM
Last activity: May 25, 2023, 11:43 PM