public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely@secretlab.ca>
To: Peter Rusko <rusko.peter@prolan.hu>, David Jander <david@protonic.nl>
Cc: linux-kernel@vger.kernel.org
Subject: Re: PCA GPIO interrupt triggers
Date: Sat, 24 Mar 2012 17:02:12 +0000	[thread overview]
Message-ID: <20120324170212.C68A43E09EE@localhost> (raw)
In-Reply-To: <4F6B4C11.4000608@prolan.hu>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1541 bytes --]

On Thu, 22 Mar 2012 16:58:09 +0100, Peter Rusko <rusko.peter@prolan.hu> wrote:
> 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:

Can someone with hardware review this patch please?  David perhaps?

g.

> 
> 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

-- 
Grant Likely, B.Sc, P.Eng.
Secret Lab Technologies,Ltd.

  reply	other threads:[~2012-03-25  0:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-22 15:58 PCA GPIO interrupt triggers Peter Rusko
2012-03-24 17:02 ` Grant Likely [this message]
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=20120324170212.C68A43E09EE@localhost \
    --to=grant.likely@secretlab.ca \
    --cc=david@protonic.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusko.peter@prolan.hu \
    /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