From: David Jander <david@protonic.nl>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Grant Likely <grant.likely@secretlab.ca>,
linux-input@vger.kernel.org, David Jander <david@protonic.nl>
Subject: [PATCH v4 3/3] Input: gpio_keys.c: Enable use with non-local GPIO chips.
Date: Tue, 14 Jun 2011 11:08:11 +0200 [thread overview]
Message-ID: <1308042491-20203-4-git-send-email-david@protonic.nl> (raw)
In-Reply-To: <1308042491-20203-1-git-send-email-david@protonic.nl>
Use a threaded interrupt handler in order to permit the handler to use
a GPIO driver that causes things like I2C transactions being done inside
the handler context.
Also, gpio_keys_init needs to be declared as a late_initcall, to make sure
all needed GPIO drivers have been loaded if the drivers are built into the
kernel.
Signed-off-by: David Jander <david@protonic.nl>
---
drivers/input/keyboard/gpio_keys.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
index 78aeeaa..d179861 100644
--- a/drivers/input/keyboard/gpio_keys.c
+++ b/drivers/input/keyboard/gpio_keys.c
@@ -3,7 +3,7 @@
*
* Copyright 2005 Phil Blundell
*
- * Added OF support:
+ * Added OF support and enabled use with I2C GPIO expanders:
* Copyright 2010 David Jander <david@protonic.nl>
*
* This program is free software; you can redistribute it and/or modify
@@ -417,7 +417,7 @@ static int __devinit gpio_keys_setup_key(struct device *dev,
if (!button->can_disable)
irqflags |= IRQF_SHARED;
- error = request_any_context_irq(irq, gpio_keys_isr, irqflags, desc, bdata);
+ error = request_threaded_irq(irq, NULL, gpio_keys_isr, irqflags, desc, bdata);
if (error < 0) {
dev_err(dev, "Unable to claim irq %d; error %d\n",
irq, error);
@@ -767,10 +767,10 @@ static void __exit gpio_keys_exit(void)
platform_driver_unregister(&gpio_keys_device_driver);
}
-module_init(gpio_keys_init);
+late_initcall(gpio_keys_init);
module_exit(gpio_keys_exit);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Phil Blundell <pb@handhelds.org>");
-MODULE_DESCRIPTION("Keyboard driver for CPU GPIOs");
+MODULE_DESCRIPTION("Keyboard driver for GPIOs");
MODULE_ALIAS("platform:gpio-keys");
--
1.7.4.1
next prev parent reply other threads:[~2011-06-14 9:07 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-14 9:08 [PATCH v4 0/3] Input: gpio_keys.c: Add support for OF and I2C GPIO chips David Jander
2011-06-14 9:08 ` [PATCH v4 1/3] Input: gpio_keys.c: Simplify platform_device -> device casting David Jander
2011-06-16 19:28 ` Grant Likely
2011-06-18 10:19 ` Dmitry Torokhov
2011-06-20 6:52 ` David Jander
2011-06-20 8:32 ` Dmitry Torokhov
2011-06-14 9:08 ` [PATCH v4 2/3] Input: gpio_keys.c: Added support for device-tree platform data David Jander
2011-06-16 19:25 ` Grant Likely
2011-06-17 8:58 ` David Jander
2011-06-17 12:54 ` Grant Likely
2011-06-23 8:24 ` Dmitry Torokhov
2011-06-23 8:55 ` David Jander
2011-06-14 9:08 ` David Jander [this message]
2011-06-16 19:27 ` [PATCH v4 3/3] Input: gpio_keys.c: Enable use with non-local GPIO chips Grant Likely
2011-06-18 10:17 ` Dmitry Torokhov
2011-06-18 13:18 ` Grant Likely
2011-06-18 14:51 ` Dmitry Torokhov
2011-06-18 15:16 ` Grant Likely
2011-06-20 7:48 ` David Jander
2011-06-20 8:45 ` Dmitry Torokhov
2011-06-20 9:33 ` David Jander
2011-06-20 18:49 ` Grant Likely
2011-06-20 18:13 ` Grant Likely
2011-06-21 11:46 ` Mark Brown
[not found] ` <BANLkTikjUR_9wq_tGfomLZNdurvmEH1Jxw@mail.gmail.com>
2011-06-21 14:36 ` David Jander
2011-06-21 17:27 ` Mark Brown
2011-06-21 20:48 ` Dmitry Torokhov
2011-06-21 23:02 ` Mark Brown
2011-06-22 6:11 ` David Jander
2011-06-22 7:00 ` Dmitry Torokhov
2011-06-22 11:38 ` Mark Brown
2011-06-22 14:58 ` Grant Likely
2011-06-22 21:43 ` Dmitry Torokhov
2011-06-20 17:03 ` H Hartley Sweeten
2011-06-20 18:20 ` Grant Likely
2011-06-21 6:55 ` David Jander
2011-06-21 7:04 ` Grant Likely
2012-03-16 7:20 ` Dmitry Torokhov
2012-03-16 8:17 ` David Jander
2012-03-16 8:32 ` Dmitry Torokhov
2012-03-16 8:48 ` David Jander
2012-03-16 10:19 ` Ben Dooks
2012-03-16 10:18 ` Ben Dooks
2012-03-16 11:08 ` David Jander
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=1308042491-20203-4-git-send-email-david@protonic.nl \
--to=david@protonic.nl \
--cc=dmitry.torokhov@gmail.com \
--cc=grant.likely@secretlab.ca \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).