All of lore.kernel.org
 help / color / mirror / Atom feed
From: jooaun <jasaw81@gmail.com>
To: dmitry.torokhov@gmail.com
Cc: linux-input@vger.kernel.org, raphaelpereira@gmail.com,
	jooaun <jasaw81@gmail.com>
Subject: [PATCH 7/8] qt2160: optional interrupt flag
Date: Tue,  9 Nov 2010 13:46:48 +1100	[thread overview]
Message-ID: <1289270808-4334-1-git-send-email-jasaw81@gmail.com> (raw)
In-Reply-To: <1289268911-32322-7-git-send-email-jasaw81@gmail.com>

Some GPIOs do not support falling edge only interrupt, so make interrupt flag configurable.
Signed-off-by: Joo Aun Saw <jasaw81@gmail.com>
---
 drivers/input/keyboard/qt2160.c |   11 +++++++++--
 include/linux/input/qt2160.h    |    2 ++
 2 files changed, 11 insertions(+), 2 deletions(-)

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__ */
-- 
1.7.0.4


  reply	other threads:[~2010-11-09  2:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-09  2:15 [PATCH 1/8] qt2160: add slider support jooaun
2010-11-09  2:15 ` [PATCH 2/8] qt2160: configurable key sensitivity jooaun
2010-11-09  2:43   ` jooaun
2010-11-09  2:15 ` [PATCH 3/8] qt2160: add PM support jooaun
2010-11-09  2:15 ` [PATCH 4/8] qt2160: add configurable power mode jooaun
2010-11-09  2:15 ` [PATCH 5/8] qt2160: fix starting of device calibration jooaun
2010-11-09  2:15 ` [PATCH 6/8] qt2160: only read device when Change pin is active jooaun
2010-11-09  2:45   ` jooaun
2010-11-09  2:15 ` [PATCH 7/8] qt2160: optional interrupt flag jooaun
2010-11-09  2:46   ` jooaun [this message]
2010-11-09  2:15 ` [PATCH 8/8] qt2160: add hardware reset jooaun
2010-11-09  2:47   ` jooaun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1289270808-4334-1-git-send-email-jasaw81@gmail.com \
    --to=jasaw81@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=raphaelpereira@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.