From a854851588f2b164b1c8914f67400a867c4c5c10 Mon Sep 17 00:00:00 2001 From: Ritesh Kumar Date: Mon, 17 May 2021 19:40:19 +0530 Subject: [PATCH] input: touchscreen: nt36xxx: Skip i2c tx during tui suspend During suspend while trusted touch is active, remove wait for trusted touch to complete and skip i2c transfer. This avoids delay during suspend. Change-Id: Iec6b1eed86e841343d4ca3513f32fb892911b7d7 Signed-off-by: Ritesh Kumar --- drivers/input/touchscreen/nt36xxx/nt36xxx.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/input/touchscreen/nt36xxx/nt36xxx.c b/drivers/input/touchscreen/nt36xxx/nt36xxx.c index c93680ba8fb6..f86d96a1bd9e 100644 --- a/drivers/input/touchscreen/nt36xxx/nt36xxx.c +++ b/drivers/input/touchscreen/nt36xxx/nt36xxx.c @@ -3082,10 +3082,6 @@ static int32_t nvt_ts_suspend(struct device *dev) } #ifdef CONFIG_NOVATEK_TRUSTED_TOUCH - if (atomic_read(&ts->trusted_touch_underway)) - wait_for_completion_interruptible( - &ts->trusted_touch_powerdown); - atomic_set(&ts->suspend_resume_underway, 1); reinit_completion(&ts->touch_suspend_resume); #endif @@ -3120,7 +3116,10 @@ static int32_t nvt_ts_suspend(struct device *dev) //---write command to enter "deep sleep mode"--- buf[0] = EVENT_MAP_HOST_CMD; buf[1] = 0x11; - CTP_I2C_WRITE(ts->client, I2C_FW_Address, buf, 2); +#ifdef CONFIG_NOVATEK_TRUSTED_TOUCH + if (!atomic_read(&ts->trusted_touch_underway)) + CTP_I2C_WRITE(ts->client, I2C_FW_Address, buf, 2); +#endif #endif // WAKEUP_GESTURE mutex_unlock(&ts->lock);