public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Rusko <rusko.peter@prolan.hu>
To: Wolfram Sang <w.sang@pengutronix.de>
Cc: Grant Likely <grant.likely@secretlab.ca>, <linux-kernel@vger.kernel.org>
Subject: Re: PCA GPIO interrupt triggers, matrix-keypad
Date: Mon, 26 Mar 2012 12:27:28 +0200	[thread overview]
Message-ID: <4F704490.7000308@prolan.hu> (raw)
In-Reply-To: <20120325074012.GA25173@pengutronix.de>

> ? I fail to see why having EDGE_FALLING together with EDGE_RISING is not
> supported. Are you sure you didn't use some other IRQ_TYPE here?
>
Yes, you're right, the problem is not there.

>> I think, this patch should work:
>
> Think? Can't you test it :)
I wish that could be that simple :)

I can test it with the matrix-keypad driver. But there's an inverter
(+delay) in the circuit (to prevent contact bounce) and I don't know how
it affects the signals. But in the end sometimes I don't get e.g. the
key-release event.

Another change in the code was with the IRQ request. I could only make
the matrix-keypad driver working with threaded interrupts:

diff --git a/drivers/input/keyboard/matrix_keypad.c 
b/drivers/input/keyboard/matrix_keypad.c
index e2ae657..f047502 100644
--- a/drivers/input/keyboard/matrix_keypad.c
+++ b/drivers/input/keyboard/matrix_keypad.c
@@ -48,7 +48,7 @@ struct matrix_keypad {
  static void __activate_col(const struct matrix_keypad_platform_data 
*pdata,
                            int col, bool on)
  {
-       bool level_on = !pdata->active_low;
+       bool level_on = (!pdata->active_low)^(!!pdata->invert_output);

         if (on) {
                 gpio_direction_output(pdata->col_gpios[col], level_on);
@@ -341,7 +341,8 @@ static int __devinit init_matrix_gpio(struct 
platform_device *pdev,
                 }
         } else {
                 for (i = 0; i < pdata->num_row_gpios; i++) {
-                       err = request_irq(gpio_to_irq(pdata->row_gpios[i]),
+                       err = 
request_threaded_irq(gpio_to_irq(pdata->row_gpios[i]),
+                                       NULL,
                                         matrix_keypad_interrupt,
                                         IRQF_TRIGGER_RISING |
                                         IRQF_TRIGGER_FALLING,

Is this okay, or is there another way?

Regards,
Peter

  reply	other threads:[~2012-03-26 10:27 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
2012-03-25  7:40 ` Wolfram Sang
2012-03-26 10:27   ` Peter Rusko [this message]
2012-03-27  7:54     ` PCA GPIO interrupt triggers, matrix-keypad 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=4F704490.7000308@prolan.hu \
    --to=rusko.peter@prolan.hu \
    --cc=grant.likely@secretlab.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=w.sang@pengutronix.de \
    /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