Skip to contentSkip to conversation

Input: ili210x: Allow IRQ to share GPIO

PATCH In review Adam Ford 2 participants 2 messages Feb 28, 2024 – Mar 5, 2024

Subsystems (2)
lore
Share & tools
lore

Adam Ford

author
#0 lore raw

PATCH 1/1 Input: ili210x: Allow IRQ to share GPIO

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.

drivers/input/touchscreen/ili210x.c +1 -1
index 31ffdc2a93f3..ebad20f451bd 100644
@@ -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);
Signature · 1 line
2.43.0
maintainer
#1 lore raw

Hi Adam,

Quoted 4 lines · Adam Ford

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.

Signature · 1 line
Dmitry