public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Rusko <rusko.peter@prolan.hu>
To: Grant Likely <grant.likely@secretlab.ca>
Cc: <linux-kernel@vger.kernel.org>
Subject: PCA GPIO interrupt triggers
Date: Thu, 22 Mar 2012 16:58:09 +0100	[thread overview]
Message-ID: <4F6B4C11.4000608@prolan.hu> (raw)

Hi,

I'm using a GPIO chip (PCA9554) for a matrix-keypad. The keypad driver 
itself needs interrupts for both rising and falling edges. The PCA 
driver (gpio-pca953x.c) doesn't support it, but I don't understand why.

I think, this patch should work:

diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
index 147df8a..be9aff4 100644
--- a/drivers/gpio/gpio-pca953x.c
+++ b/drivers/gpio/gpio-pca953x.c
@@ -356,12 +356,6 @@ static int pca953x_irq_set_type(struct irq_data *d, 
unsigned int type)
         uint16_t level = d->irq - chip->irq_base;
         uint16_t mask = 1 << level;

-       if (!(type & IRQ_TYPE_EDGE_BOTH)) {
-               dev_err(&chip->client->dev, "irq %d: unsupported type %d\n",
-                       d->irq, type);
-               return -EINVAL;
-       }
-
         if (type & IRQ_TYPE_EDGE_FALLING)
                 chip->irq_trig_fall |= mask;
         else

I think that the other parts of the code checks for rising and falling 
edges correctly. Am I missing something?

-- 
Ruskó Péter
Fejlesztőmérnök

Prolan Zrt. / Prolan Co.
Hungary 2011 Budakalász, Szentendrei út 1-3.
Tel./Phone: +36 20 954 3118
Fax: +36 26 540 420
E-mail: rusko.peter@prolan.hu
Web: www.prolan.hu
Timezone:CET

             reply	other threads:[~2012-03-23  5:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-22 15:58 Peter Rusko [this message]
2012-03-24 17:02 ` PCA GPIO interrupt triggers Grant Likely
2012-03-25  7:40 ` Wolfram Sang
2012-03-26 10:27   ` PCA GPIO interrupt triggers, matrix-keypad Peter Rusko
2012-03-27  7:54     ` Wolfram Sang

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=4F6B4C11.4000608@prolan.hu \
    --to=rusko.peter@prolan.hu \
    --cc=grant.likely@secretlab.ca \
    --cc=linux-kernel@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