轉自:https://blog.csdn.net/kk20000/article/details/83041081函數
使用的匯頂的觸摸驅動的時候會從新亮屏速度慢3秒,而在使用另一個敦泰觸摸驅動的時候沒有發現問題。
比較代碼後發現,fb_notifier_callback的影響是關鍵..net
有問題的代碼是:blog
static int fb_notifier_callback(struct notifier_block *self,
unsigned long event, void *data)
{
struct fb_event *evdata = data;
int *blank;
struct goodix_ts_data *ts =
container_of(self, struct goodix_ts_data, fb_notif);隊列
if (evdata && evdata->data && event == FB_EVENT_BLANK &&
ts && ts->client) {
blank = evdata->data;get
GTP_DEBUG("fb notifier callback blank :%d",*blank);event
if (*blank == FB_BLANK_UNBLANK)
goodix_ts_resume(&ts->client->dev);
else if (*blank == FB_BLANK_POWERDOWN)
goodix_ts_suspend(&ts->client->dev);
}
return 0;
}cli
修改成下面的方式後正常:call
static int fb_notifier_callback(struct notifier_block *self,callback
unsigned long event, void *data)
{
struct fb_event *evdata = data;
int *blank;
struct goodix_ts_data *ts =
container_of(self, struct goodix_ts_data, fb_notif);
if (evdata && evdata->data && event == FB_EARLY_EVENT_BLANK && ts && ts->client)
{
blank = evdata->data;
GTP_DEBUG ("fb_notifier_callback:goodix blank=%d\n", *blank);
if (*blank == FB_BLANK_UNBLANK)
{
if (!work_pending (&ts->resume_work))
{
schedule_work (&ts->resume_work);
}
}
else if (*blank == FB_BLANK_POWERDOWN)
{
cancel_work_sync (&ts->resume_work);
goodix_ts_suspend (&ts->client->dev);
}
}
else if (event == FB_R_EARLY_EVENT_BLANK)
{
if (!work_pending (&ts->resume_work))
{
schedule_work (&ts->resume_work);
}
}static
return 0;}