From ef0d746f8ac43b194e56473d54a6d4fa402a39bf Mon Sep 17 00:00:00 2001 From: Wenge Zhu Date: Fri, 17 Mar 2023 17:22:02 +0800 Subject: [PATCH] Add gesture pm for goodix touch TP: Wait bus ready before read gesture data from IC. Change-Id: I17caa70cadcb0a3ac9c4399481c11e43e8a8ef1c Signed-off-by: Wenge Zhu Reviewed-on: https://gerrit.mot.com/2543551 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: litong Reviewed-by: Guobin Zhang Submit-Approved: Jira Key --- .../touchscreen/goodix_berlin_mmi/goodix_ts_gesture.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/input/touchscreen/goodix_berlin_mmi/goodix_ts_gesture.c b/drivers/input/touchscreen/goodix_berlin_mmi/goodix_ts_gesture.c index af50591f1fd2..bf8794fdfe74 100644 --- a/drivers/input/touchscreen/goodix_berlin_mmi/goodix_ts_gesture.c +++ b/drivers/input/touchscreen/goodix_berlin_mmi/goodix_ts_gesture.c @@ -231,6 +231,16 @@ static int gsx_gesture_ist(struct goodix_ts_core *cd, if (atomic_read(&cd->suspended) == 0) return EVT_CONTINUE; + if (cd->board_data.gesture_wait_pm) { + PM_WAKEUP_EVENT(cd->gesture_wakelock, 3000); + /* Waiting for pm resume completed */ + ret = wait_event_interruptible_timeout(cd->pm_wq, atomic_read(&cd->pm_resume), msecs_to_jiffies(700)); + if (!ret) { + ts_err("system(spi) can't finished resuming procedure."); + return IRQ_HANDLED; + } + } + ret = hw_ops->event_handler(cd, &gs_event); if (ret) { ts_err("failed get gesture data");