diff mbox

[7/8] qt2160: optional interrupt flag

Message ID 1289268911-32322-7-git-send-email-jasaw81@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

jooaun Nov. 9, 2010, 2:15 a.m. UTC
None
diff mbox

Patch

diff --git a/drivers/input/keyboard/qt2160.c b/drivers/input/keyboard/qt2160.c
index 8316fde..d2ce573 100755
--- a/drivers/input/keyboard/qt2160.c
+++ b/drivers/input/keyboard/qt2160.c
@@ -487,8 +487,15 @@  static int __devinit qt2160_probe(struct i2c_client *client,
 	}
 
 	if (client->irq) {
-		error = request_irq(client->irq, qt2160_irq,
-				    IRQF_TRIGGER_FALLING, "qt2160", qt2160);
+		if (hw_info->irq_flags) {
+			error = request_irq(client->irq, qt2160_irq,
+					    hw_info->irq_flags, "qt2160",
+					    qt2160);
+		} else {
+			error = request_irq(client->irq, qt2160_irq,
+					    IRQF_TRIGGER_FALLING, "qt2160",
+					    qt2160);
+		}
 		if (error) {
 			dev_err(&client->dev,
 				"failed to allocate irq %d\n", client->irq);
diff --git a/include/linux/input/qt2160.h b/include/linux/input/qt2160.h
index 4eb7e18..dad11bb 100755
--- a/include/linux/input/qt2160.h
+++ b/include/linux/input/qt2160.h
@@ -21,6 +21,7 @@ 
  * @key_burst_length: key sensitivity; 0 use default
  * @low_power_mode: value 0 use default; each +1 increment causes the chip to
  *  sleep 16ms longer before detecting a touch (slower response); max 255
+ * @irq_flags: value 0 use default IRQF_TRIGGER_FALLING
  */
 struct qt2160_info {
 	void *data;
@@ -31,6 +32,7 @@  struct qt2160_info {
 	unsigned char key_aks[QT2160_MAXKEYS];
 	unsigned char key_burst_length[QT2160_MAXKEYS];
 	unsigned char low_power_mode;
+	unsigned long irq_flags;
 };
 
 #endif /* __QT2160_H__ */