From: Fabio Estevam <festevam@gmail.com>
To: sameo@linux.intel.com
Cc: broonie@opensource.wolfsonmicro.com,
ashish.jangam@kpitcummins.com, dchen@diasemi.com, arnd@arndb.de,
kernel@pengutronix.de, linux-kernel@vger.kernel.org,
Fabio Estevam <fabio.estevam@freescale.com>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
<linux-input@vger.kernel.org>
Subject: [PATCH 4/6] Input: da9052_onkey.c: Convert to the new da9052 interrupt functions.
Date: Thu, 4 Oct 2012 00:15:07 -0300 [thread overview]
Message-ID: <1349320509-26930-4-git-send-email-festevam@gmail.com> (raw)
In-Reply-To: <1349320509-26930-1-git-send-email-festevam@gmail.com>
From: Fabio Estevam <fabio.estevam@freescale.com>
Use the new da9052 irq functions and allow the driver to probe successfully.
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: <linux-input@vger.kernel.org>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
drivers/input/misc/da9052_onkey.c | 22 +++++-----------------
1 file changed, 5 insertions(+), 17 deletions(-)
diff --git a/drivers/input/misc/da9052_onkey.c b/drivers/input/misc/da9052_onkey.c
index 3c843cd..3be3acc 100644
--- a/drivers/input/misc/da9052_onkey.c
+++ b/drivers/input/misc/da9052_onkey.c
@@ -24,7 +24,6 @@ struct da9052_onkey {
struct da9052 *da9052;
struct input_dev *input;
struct delayed_work work;
- unsigned int irq;
};
static void da9052_onkey_query(struct da9052_onkey *onkey)
@@ -76,7 +75,6 @@ static int __devinit da9052_onkey_probe(struct platform_device *pdev)
struct da9052 *da9052 = dev_get_drvdata(pdev->dev.parent);
struct da9052_onkey *onkey;
struct input_dev *input_dev;
- int irq;
int error;
if (!da9052) {
@@ -84,13 +82,6 @@ static int __devinit da9052_onkey_probe(struct platform_device *pdev)
return -EINVAL;
}
- irq = platform_get_irq_byname(pdev, "ONKEY");
- if (irq < 0) {
- dev_err(&pdev->dev,
- "Failed to get an IRQ for input device, %d\n", irq);
- return -EINVAL;
- }
-
onkey = kzalloc(sizeof(*onkey), GFP_KERNEL);
input_dev = input_allocate_device();
if (!onkey || !input_dev) {
@@ -101,7 +92,6 @@ static int __devinit da9052_onkey_probe(struct platform_device *pdev)
onkey->input = input_dev;
onkey->da9052 = da9052;
- onkey->irq = irq;
INIT_DELAYED_WORK(&onkey->work, da9052_onkey_work);
input_dev->name = "da9052-onkey";
@@ -111,13 +101,11 @@ static int __devinit da9052_onkey_probe(struct platform_device *pdev)
input_dev->evbit[0] = BIT_MASK(EV_KEY);
__set_bit(KEY_POWER, input_dev->keybit);
- error = request_threaded_irq(onkey->irq, NULL, da9052_onkey_irq,
- IRQF_TRIGGER_LOW | IRQF_ONESHOT,
- "ONKEY", onkey);
+ error = da9052_request_irq(onkey->da9052, DA9052_IRQ_NONKEY, "ONKEY",
+ da9052_onkey_irq, onkey);
if (error < 0) {
dev_err(onkey->da9052->dev,
- "Failed to register ONKEY IRQ %d, error = %d\n",
- onkey->irq, error);
+ "Failed to register ONKEY IRQ: %d\n", error);
goto err_free_mem;
}
@@ -132,7 +120,7 @@ static int __devinit da9052_onkey_probe(struct platform_device *pdev)
return 0;
err_free_irq:
- free_irq(onkey->irq, onkey);
+ da9052_free_irq(onkey->da9052, DA9052_IRQ_NONKEY, onkey);
cancel_delayed_work_sync(&onkey->work);
err_free_mem:
input_free_device(input_dev);
@@ -145,7 +133,7 @@ static int __devexit da9052_onkey_remove(struct platform_device *pdev)
{
struct da9052_onkey *onkey = platform_get_drvdata(pdev);
- free_irq(onkey->irq, onkey);
+ da9052_free_irq(onkey->da9052, DA9052_IRQ_NONKEY, onkey);
cancel_delayed_work_sync(&onkey->work);
input_unregister_device(onkey->input);
--
1.7.9.5
next prev parent reply other threads:[~2012-10-04 3:16 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-04 3:15 [PATCH 1/6] mfd: da9052-core: Use regmap_irq_get_virq() and fix the probe Fabio Estevam
2012-10-04 3:15 ` [PATCH 2/6] mfd: da9052: Introduce da9052-irq.c Fabio Estevam
2012-10-04 7:12 ` Arnd Bergmann
2012-10-04 11:14 ` Mark Brown
2012-10-04 12:17 ` Arnd Bergmann
2012-10-04 11:25 ` Mark Brown
2012-10-04 3:15 ` [PATCH 3/6] Input: da9052_tsi.c: Fix interrupt handling Fabio Estevam
2012-10-04 3:15 ` Fabio Estevam [this message]
2012-10-05 18:57 ` [PATCH 4/6] Input: da9052_onkey.c: Convert to the new da9052 interrupt functions Mark Brown
2012-10-04 3:15 ` [PATCH 5/6] power: da9052-battery: " Fabio Estevam
2012-10-05 18:58 ` Mark Brown
2012-11-18 4:20 ` Anton Vorontsov
2012-11-18 12:30 ` Fabio Estevam
2012-10-04 3:15 ` [PATCH 6/6] gpio: gpio-da9052: " Fabio Estevam
2012-10-04 11:26 ` Mark Brown
2012-10-08 6:20 ` Linus Walleij
2012-10-08 10:40 ` Fabio Estevam
2012-10-09 12:04 ` Linus Walleij
2012-10-09 12:19 ` Fabio Estevam
2012-10-04 11:26 ` [PATCH 1/6] mfd: da9052-core: Use regmap_irq_get_virq() and fix the probe Mark Brown
2012-11-12 16:22 ` Fabio Estevam
2012-11-18 23:44 ` Samuel Ortiz
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=1349320509-26930-4-git-send-email-festevam@gmail.com \
--to=festevam@gmail.com \
--cc=arnd@arndb.de \
--cc=ashish.jangam@kpitcummins.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=dchen@diasemi.com \
--cc=dmitry.torokhov@gmail.com \
--cc=fabio.estevam@freescale.com \
--cc=kernel@pengutronix.de \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sameo@linux.intel.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 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).