linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input: ili210x:  Allow IRQ to share GPIO
@ 2024-02-28 11:41 Adam Ford
  2024-03-05 17:28 ` Dmitry Torokhov
  0 siblings, 1 reply; 2+ messages in thread
From: Adam Ford @ 2024-02-28 11:41 UTC (permalink / raw)
  To: linux-input; +Cc: aford, Adam Ford, Dmitry Torokhov, linux-kernel

The IRQ registration currently assumes that the GPIO is
dedicated to it, but that may not necessarily be the case.
If the board has another device sharing the IRQ, it won't be
registered and the touch detect fails.

Signed-off-by: Adam Ford <aford173@gmail.com>

diff --git a/drivers/input/touchscreen/ili210x.c b/drivers/input/touchscreen/ili210x.c
index 31ffdc2a93f3..ebad20f451bd 100644
--- a/drivers/input/touchscreen/ili210x.c
+++ b/drivers/input/touchscreen/ili210x.c
@@ -1003,7 +1003,7 @@ static int ili210x_i2c_probe(struct i2c_client *client)
 	}
 
 	error = devm_request_threaded_irq(dev, client->irq, NULL, ili210x_irq,
-					  IRQF_ONESHOT, client->name, priv);
+					  IRQF_ONESHOT | IRQF_SHARED, client->name, priv);
 	if (error) {
 		dev_err(dev, "Unable to request touchscreen IRQ, err: %d\n",
 			error);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Input: ili210x:  Allow IRQ to share GPIO
  2024-02-28 11:41 [PATCH] Input: ili210x: Allow IRQ to share GPIO Adam Ford
@ 2024-03-05 17:28 ` Dmitry Torokhov
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2024-03-05 17:28 UTC (permalink / raw)
  To: Adam Ford; +Cc: linux-input, aford, linux-kernel

Hi Adam,

On Wed, Feb 28, 2024 at 05:41:42AM -0600, Adam Ford wrote:
> The IRQ registration currently assumes that the GPIO is
> dedicated to it, but that may not necessarily be the case.
> If the board has another device sharing the IRQ, it won't be
> registered and the touch detect fails.

I do not believe the driver is prepared to handle shared interrupts.
First of all, it disables interrupts in the firmware update path, which
will interfere with operation of other device using the same line.

You also need to make sure the driver properly recognizes condition when
interrupt is raised by another device and Ilitek controller does not
have any data to transfer/return. In this case we need to make sure we
do not log any errors, not release any active contacts, etc.

Thanks.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-03-05 17:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-28 11:41 [PATCH] Input: ili210x: Allow IRQ to share GPIO Adam Ford
2024-03-05 17:28 ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).