All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mika Westerberg <ext-mika.1.westerberg@nokia.com>
To: dmitry.torokhov@gmail.com
Cc: linux-input@vger.kernel.org
Subject: [PATCH 1/2] Input: gpio-keys: allow drivers to specify whether IRQ can be shared
Date: Thu, 19 Nov 2009 09:23:45 +0200	[thread overview]
Message-ID: <dacbc701ebdd15c48ebb32920bf70fd42aa14baa.1258614931.git.ext-mika.1.westerberg@nokia.com> (raw)
In-Reply-To: <cover.1258614931.git.ext-mika.1.westerberg@nokia.com>
In-Reply-To: <cover.1258614931.git.ext-mika.1.westerberg@nokia.com>

Added new field to struct gpio_keys_button: exclusive_irq which can
be used to specify whether driver wants to have exclusive access to
IRQ or can it be shared. By default IRQs for gpio-keys are shareable.

Signed-off-by: Mika Westerberg <ext-mika.1.westerberg@nokia.com>
---
 drivers/input/keyboard/gpio_keys.c |   14 ++++++++++----
 include/linux/gpio_keys.h          |    1 +
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
index 8941a8b..113d187 100644
--- a/drivers/input/keyboard/gpio_keys.c
+++ b/drivers/input/keyboard/gpio_keys.c
@@ -78,6 +78,7 @@ static int __devinit gpio_keys_setup_key(struct device *dev,
 					 struct gpio_keys_button *button)
 {
 	char *desc = button->desc ? button->desc : "gpio_keys";
+	unsigned long irqflags;
 	int irq, error;
 
 	setup_timer(&bdata->timer, gpio_keys_timer, (unsigned long)bdata);
@@ -106,10 +107,15 @@ static int __devinit gpio_keys_setup_key(struct device *dev,
 		goto fail3;
 	}
 
-	error = request_irq(irq, gpio_keys_isr,
-			    IRQF_SHARED |
-			    IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
-			    desc, bdata);
+	irqflags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING;
+	/*
+	 * If not explicitly specified in platform data, we allow
+	 * IRQs to be shared with some other device.
+	 */
+	if (!button->exclusive_irq)
+		irqflags |= IRQF_SHARED;
+
+	error = request_irq(irq, gpio_keys_isr, irqflags, desc, bdata);
 	if (error) {
 		dev_err(dev, "Unable to claim irq %d; error %d\n",
 			irq, error);
diff --git a/include/linux/gpio_keys.h b/include/linux/gpio_keys.h
index 1289fa7..82639c7 100644
--- a/include/linux/gpio_keys.h
+++ b/include/linux/gpio_keys.h
@@ -10,6 +10,7 @@ struct gpio_keys_button {
 	int type;		/* input event type (EV_KEY, EV_SW) */
 	int wakeup;		/* configure the button as a wake-up source */
 	int debounce_interval;	/* debounce ticks interval in msecs */
+	int exclusive_irq;	/* don't share the irq */
 };
 
 struct gpio_keys_platform_data {
-- 
1.5.6.5


  reply	other threads:[~2009-11-19  7:28 UTC|newest]

Thread overview: 101+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-23 12:15 [RFC PATCH 0/1] Enabling/disabling separate gpio-keys buttons Mika Westerberg
2009-10-23 12:15 ` [RFC PATCH 1/1] Input: gpio-keys: export gpio key information through sysfs Mika Westerberg
2009-10-28  5:43   ` Dmitry Torokhov
2009-10-28 10:50     ` Mika Westerberg
2009-11-04  9:06       ` Mika Westerberg
2009-11-04  9:25         ` Artem Bityutskiy
2009-11-06  7:52           ` Dmitry Torokhov
2009-11-09 15:09             ` Artem Bityutskiy
2009-11-09 17:18               ` Dmitry Torokhov
2009-11-10 11:04                 ` Artem Bityutskiy
2009-11-10 17:19                   ` Dmitry Torokhov
2009-11-11  6:50                     ` Artem Bityutskiy
2009-11-11  8:19                       ` Dmitry Torokhov
2009-11-11  8:52                         ` Artem Bityutskiy
2009-11-11  9:59                           ` Dmitry Torokhov
2009-11-11 10:26                             ` Artem Bityutskiy
2009-11-11 10:30                               ` Artem Bityutskiy
2009-11-11 17:40                               ` Dmitry Torokhov
2009-11-12  5:31                                 ` Artem Bityutskiy
2009-11-19  7:23                               ` [PATCH 0/2] Input: gpio-keys: support for disabling GPIOs Mika Westerberg
2009-11-19  7:23                                 ` Mika Westerberg [this message]
2009-11-19  7:23                                   ` [PATCH 2/2] Input: gpio-keys: added support for disabling gpios through sysfs Mika Westerberg
2009-11-20  8:40                                     ` Dmitry Torokhov
2009-11-20 12:17                                       ` Mika Westerberg
2009-11-23 12:39                                       ` [PATCH v2 0/2] Input: gpio-keys: support for disabling GPIOs Mika Westerberg
2009-11-23 12:39                                         ` [PATCH v2 1/2] Input: gpio-keys - allow platform to specify exact irq flags Mika Westerberg
2009-11-23 12:39                                           ` [PATCH v2 2/2] Input: gpio-keys - added support for disabling gpios through sysfs Mika Westerberg
2009-11-23 16:42                                           ` [PATCH v2 1/2] Input: gpio-keys - allow platform to specify exact irq flags Ferenc Wagner
2009-11-23 17:24                                             ` Dmitry Torokhov
2009-11-23 18:50                                               ` Ferenc Wagner
2009-11-24  6:37                                                 ` Mika Westerberg
2009-11-24 11:05                                                   ` Ferenc Wagner
2009-11-24 17:02                                                     ` Mika Westerberg
2009-11-24 18:39                                                       ` Ferenc Wagner
2009-11-26  6:35                                                         ` Dmitry Torokhov
2009-11-27 10:54                                                           ` Mika Westerberg
2009-11-28 12:16                                                             ` Ferenc Wagner
2009-11-28 13:27                                                               ` Mika Westerberg
2009-11-29 12:26                                                                 ` Ferenc Wagner
2009-11-29 12:26                                                                 ` Ferenc Wagner
2009-11-29 16:04                                                                   ` Alan Stern
2009-11-29 16:04                                                                   ` [linux-pm] " Alan Stern
2009-11-29 22:58                                                                     ` Ferenc Wagner
2009-11-30  8:27                                                                       ` Mika Westerberg
2009-11-30  8:27                                                                       ` [linux-pm] " Mika Westerberg
2009-11-30  9:14                                                                         ` Dmitry Torokhov
2009-11-30  9:14                                                                         ` [linux-pm] " Dmitry Torokhov
2009-11-30  9:37                                                                           ` Mika Westerberg
2009-11-30  9:37                                                                           ` [linux-pm] " Mika Westerberg
2009-12-01  0:07                                                                             ` Ferenc Wagner
2009-11-30 20:59                                                                         ` Ferenc Wagner
2009-12-01  0:37                                                                           ` Dmitry Torokhov
2009-12-01  1:05                                                                             ` Ferenc Wagner
2009-11-29 22:58                                                                     ` Ferenc Wagner
2009-11-30  9:16                                                                     ` [linux-pm] " Dmitry Torokhov
2009-11-30 15:00                                                                       ` Alan Stern
2009-11-30 19:05                                                                         ` Ferenc Wagner
2009-11-30 19:05                                                                         ` [linux-pm] " Ferenc Wagner
2009-11-30 19:30                                                                           ` Alan Stern
2009-11-30 20:51                                                                             ` Ferenc Wagner
2009-11-30 21:59                                                                               ` Alan Stern
2009-11-30 21:59                                                                               ` [linux-pm] " Alan Stern
2009-12-01 10:08                                                                                 ` Ferenc Wagner
2009-12-01 10:08                                                                                 ` [linux-pm] " Ferenc Wagner
2009-12-01 15:11                                                                                   ` Alan Stern
2009-12-01 15:11                                                                                   ` Alan Stern
2009-11-30 20:51                                                                             ` Ferenc Wagner
2009-11-30 19:30                                                                           ` Alan Stern
2009-12-06  8:47                                                                           ` Pavel Machek
2009-12-06  8:47                                                                           ` [linux-pm] " Pavel Machek
2009-12-08  4:22                                                                             ` Dmitry Torokhov
2009-12-08 13:03                                                                               ` Artem Bityutskiy
2009-12-08 13:03                                                                               ` [linux-pm] " Artem Bityutskiy
2009-12-08 17:42                                                                                 ` Dmitry Torokhov
2009-12-08 17:42                                                                                 ` [linux-pm] " Dmitry Torokhov
2009-12-09  7:31                                                                                   ` Artem Bityutskiy
2009-12-09  7:31                                                                                   ` [linux-pm] " Artem Bityutskiy
2009-12-09 18:03                                                                                     ` Dmitry Torokhov
2009-12-09 21:08                                                                                       ` Pavel Machek
2009-12-09 21:48                                                                                         ` Dmitry Torokhov
2009-12-09 21:48                                                                                         ` [linux-pm] " Dmitry Torokhov
2009-12-10 10:13                                                                                           ` Pavel Machek
2009-12-10 10:13                                                                                           ` Pavel Machek
2009-12-09 21:08                                                                                       ` Pavel Machek
2009-12-10  9:19                                                                                       ` [linux-pm] " Artem Bityutskiy
2009-12-10  9:19                                                                                       ` Artem Bityutskiy
2009-12-09 18:03                                                                                     ` Dmitry Torokhov
2009-12-08  4:22                                                                             ` Dmitry Torokhov
2009-11-30 15:00                                                                       ` Alan Stern
2009-11-30  9:16                                                                     ` Dmitry Torokhov
2009-12-06  8:46                                                                   ` [linux-pm] " Pavel Machek
2009-12-06  8:46                                                                   ` Pavel Machek
2009-11-20  8:38                                   ` [PATCH 1/2] Input: gpio-keys: allow drivers to specify whether IRQ can be shared Dmitry Torokhov
2009-11-20 10:08                                     ` Ferenc Wagner
2009-11-11 10:36                           ` [RFC PATCH 0/2] Input: adding new ioctl()s for enabling/disabling events Mika Westerberg
2009-11-11 10:36                             ` [RFC PATCH 1/2] Input: added 2 new ioctl()s for setting/getting event state Mika Westerberg
2009-11-11 10:36                               ` [RFC PATCH 2/2] Input: gpio-keys: implemented support for enabling/disabling gpios Mika Westerberg
2009-11-11 14:37                                 ` Ferenc Wagner
2009-11-11 14:52                                   ` Mika Westerberg
2009-11-11 17:08                                     ` Dmitry Torokhov
2009-11-12  6:23                                       ` Mika Westerberg

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=dacbc701ebdd15c48ebb32920bf70fd42aa14baa.1258614931.git.ext-mika.1.westerberg@nokia.com \
    --to=ext-mika.1.westerberg@nokia.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    /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.