From 8e2e7807cd774247996cdbd572182bb5abe9c8cd Mon Sep 17 00:00:00 2001
From: Haibo Chen <haibo.chen@nxp.com>
Date: Wed, 8 Sep 2021 18:26:11 +0800
Subject: [PATCH] LF-4558-1 input: touch: goodix: do not free/request irq in
 suspend/resume

Currently on imx8ulp-evk board, the interrupt pin we use is from M core
domain, need use gpio-rpmsg to handle the interrupt. If frequently free
or request this irq during suspend/resume, system will randomly hang.
As a workaround, just disable/enable instead.

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
---
 drivers/input/touchscreen/goodix.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/input/touchscreen/goodix.c b/drivers/input/touchscreen/goodix.c
index d5d761a73d24fa..f304fd84bb9fbb 100644
--- a/drivers/input/touchscreen/goodix.c
+++ b/drivers/input/touchscreen/goodix.c
@@ -442,10 +442,12 @@ static irqreturn_t goodix_ts_irq_handler(int irq, void *dev_id)
 	return IRQ_HANDLED;
 }
 
+#if 0
 static void goodix_free_irq(struct goodix_ts_data *ts)
 {
 	devm_free_irq(&ts->client->dev, ts->client->irq, ts);
 }
+#endif
 
 static int goodix_request_irq(struct goodix_ts_data *ts)
 {
@@ -1284,7 +1286,7 @@ static int __maybe_unused goodix_suspend(struct device *dev)
 	}
 
 	/* Free IRQ as IRQ pin is used as output in the suspend sequence */
-	goodix_free_irq(ts);
+	disable_irq(client->irq);
 
 	/* Output LOW on the INT pin for 5 ms */
 	error = goodix_irq_direction_output(ts, 0);
@@ -1362,9 +1364,7 @@ static int __maybe_unused goodix_resume(struct device *dev)
 		}
 	}
 
-	error = goodix_request_irq(ts);
-	if (error)
-		return error;
+	enable_irq(client->irq);
 
 	return 0;
 }
-- 
GitLab