lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 26 Mar 2012 12:27:28 +0200
From:	Peter Rusko <rusko.peter@...lan.hu>
To:	Wolfram Sang <w.sang@...gutronix.de>
CC:	Grant Likely <grant.likely@...retlab.ca>,
	<linux-kernel@...r.kernel.org>
Subject: Re: 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ