lkml.org 
[lkml]   [2012]   [Mar]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: PCA GPIO interrupt triggers, matrix-keypad
> ? 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


\
 
 \ /
  Last update: 2012-03-26 12:29    [W:0.050 / U:0.416 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site