diff mbox

[4/5] Try IRQF_TRIGGER_NONE if IRQF_TRIGGER_FALLING returns error

Message ID 4D4AB770.7090407@atmel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Iiro Valkonen Feb. 3, 2011, 2:10 p.m. UTC
None
diff mbox

Patch

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;