[PATCH 4/5] Try IRQF_TRIGGER_NONE if IRQF_TRIGGER_FALLING returns error

From
Iiro Valkonen <hidden>
Date
2011-02-03 14:10:47
Reply to
Dmitry Torokhov, 2011-02-03
I'm not sure about this one, does it make any sense? I have to do it on my test platform; if I request IRQF_TRIGGER_FALLING I get an error. With this patch everything works fine. But maybe it would be better to try to fix the platform instead...

BR,
-- 
Iiro


Input: qt602240_ts - Try IRQF_TRIGGER_NONE if IRQF_TRIGGER_FALLING returns error

From: Iiro Valkonen <redacted>

Try IRQF_TRIGGER_NONE if IRQF_TRIGGER_FALLING returns error.

Signed-off-by: Iiro Valkonen <redacted>
---
 drivers/input/touchscreen/qt602240_ts.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/drivers/input/touchscreen/qt602240_ts.c b/drivers/input/touchscreen/qt602240_ts.c
index a88ec93..208d9f7 100644
--- a/drivers/input/touchscreen/qt602240_ts.c
+++ b/drivers/input/touchscreen/qt602240_ts.c
@@ -1165,6 +1165,15 @@ static int __devinit mxt_probe(struct i2c_client *client,
 
 	error = request_threaded_irq(client->irq, NULL, mxt_interrupt,
 			IRQF_TRIGGER_FALLING, client->dev.driver->name, data);
+
+	if (error) {
+		/* If registering an interrupt with falling edge didn't work,
+		   try any edge. */
+		error = request_threaded_irq(client->irq, NULL, mxt_interrupt,
+					     IRQF_TRIGGER_NONE,
+					     client->dev.driver->name, data);
+	}
+
 	if (error) {
 		dev_err(&client->dev, "Failed to register interrupt\n");
 		goto err_free_object;
-- 
1.7.0.4
Thread (32 messages) 32 messages, 4 authors, last reply 2011-02-18
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help