public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* PCA GPIO interrupt triggers
@ 2012-03-22 15:58 Peter Rusko
  2012-03-24 17:02 ` Grant Likely
  2012-03-25  7:40 ` Wolfram Sang
  0 siblings, 2 replies; 5+ messages in thread
From: Peter Rusko @ 2012-03-22 15:58 UTC (permalink / raw)
  To: Grant Likely; +Cc: linux-kernel

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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-03-27  7:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-22 15:58 PCA GPIO interrupt triggers Peter Rusko
2012-03-24 17:02 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox