linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Matrix keypad driver
@ 2009-12-30 18:57 Jeremy Slater
  0 siblings, 0 replies; only message in thread
From: Jeremy Slater @ 2009-12-30 18:57 UTC (permalink / raw)
  To: linux-input

I am using the matrix keypad driver and I have noticed an issue where
when pressing multiple keys in the same row, only the first key is
detected.

In this driver, the logic is that we are driving the columns and
listening for interrupts on the rows.  If you press one key on row y
the following events occur:

* row y is asserted
* interrupt is generated
* debounce timeout expires
* interrupts are disabled
* matrix is scanned one column at a time
* all columns are activated
* interrupts are enabled

The problem is that if I hold this first key down and press another
key in row y, no interrupt is generated since there is now no signal
change.

If we look at the corgi driver as an example, a timer is scheduled at
the end of the scan any time a key is down.  The comment indicates
this is to catch released keys, but this method will also catch
additional key presses in the same row.  This comes at the expense of
constant scanning at some ms interval, but only when a key is held.

Another way to implement a similar process is to let the interrupt
handler continue to schedule the scan by re-enabling interrupts before
driving the columns.  This way, if any key is held down during the
scan, a new scan will be scheduled by the interrupt handler after the
debounce period.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-12-30 18:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-30 18:57 Matrix keypad driver Jeremy Slater

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).