From b4a82b4f755c4f72705e176a86ae51dc4426d131 Mon Sep 17 00:00:00 2001 From: litong Date: Mon, 2 Mar 2020 19:27:17 +0800 Subject: [PATCH] Take a long time to enter pre_suspended 1. Create a separate lock for gesture event reporting to solve the problem of blocking pre_suspend and then blocking the next wake-up. 2. According to BSP test, it takes 1500 ms for the touch to receive the gesture event and the upper layer to complete the processing. Change-Id: I93a18399876beba49100b41a0561103b2b9fa86d Reviewed-on: https://gerrit.mot.com/1505298 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Jialei Hao Reviewed-by: Jianqi Yang Submit-Approved: Jira Key --- drivers/input/touchscreen/sec_mmi/sec_ts.c | 5 ++++- drivers/input/touchscreen/sec_mmi/sec_ts.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/input/touchscreen/sec_mmi/sec_ts.c b/drivers/input/touchscreen/sec_mmi/sec_ts.c index 2cdab2650d03..804d1453ad57 100644 --- a/drivers/input/touchscreen/sec_mmi/sec_ts.c +++ b/drivers/input/touchscreen/sec_mmi/sec_ts.c @@ -901,7 +901,7 @@ static void sec_ts_read_event(struct sec_ts_data *ts) /* call class method */ ret = ts->imports->report_gesture(&event); if (!ret) - __pm_wakeup_event(&ts->wakelock, 5000); + __pm_wakeup_event(&ts->gesture_wakelock, 3000); } #endif break; @@ -1771,6 +1771,7 @@ static int sec_ts_probe(struct i2c_client *client, const struct i2c_device_id *i mutex_init(&ts->modechange); wakeup_source_init(&ts->wakelock, "tsp_wakelock"); + wakeup_source_init(&ts->gesture_wakelock, "tsp_gesture_wakelock"); init_completion(&ts->resume_done); complete_all(&ts->resume_done); @@ -1884,6 +1885,7 @@ err_irq: } err_input_register_device: kfree(ts->pFrame); + wakeup_source_trash(&ts->gesture_wakelock); wakeup_source_trash(&ts->wakelock); sec_ts_power(ts, false); if (ts->plat_data->support_dex) { @@ -2314,6 +2316,7 @@ static int sec_ts_remove(struct i2c_client *client) p_ghost_check = NULL; #endif device_init_wakeup(&client->dev, false); + wakeup_source_trash(&ts->gesture_wakelock); wakeup_source_trash(&ts->wakelock); ts->lowpower_mode = false; diff --git a/drivers/input/touchscreen/sec_mmi/sec_ts.h b/drivers/input/touchscreen/sec_mmi/sec_ts.h index c70c91fcb038..115e4d26dc4f 100644 --- a/drivers/input/touchscreen/sec_mmi/sec_ts.h +++ b/drivers/input/touchscreen/sec_mmi/sec_ts.h @@ -646,6 +646,7 @@ struct sec_ts_data { #endif struct completion resume_done; struct wakeup_source wakelock; + struct wakeup_source gesture_wakelock; struct sec_cmd_data sec; short *pFrame;