[PATCH] fix-jack-debounce.patch

Andy Green andy at openmoko.com
Fri Apr 11 12:56:51 CEST 2008

Hash: SHA1

Somebody in the thread at some point said:
| Hi,
| On 11/04/2008, Andy Green <andy at openmoko.com> wrote:
|> Headphone jack detection is bouncy, it can trigger multiple interrupts
|>  on insertion or removal.  This patch adds a workqueue that waits out the
|>  interrupt spew in 100ms units, and if it sees no more interrupts for
|>  only then samples and reports the jack state.
| If there are no spurious changes on the pin, only bouncing after a
| legal change, then it's fine to report the event on the first change
| and wait only if a previous state change was less than 100ms ago. (Not
| that it matter so much for jack detection)

The issue there is that the interrupt action from seeing an edge is
disconnected from the level sampling action that occured in the ISR.  So
we can see an initial edge that is correct as you say, but by the time
the interrupt is serviced and we sample the interrupt as GPIO level, it
may be bouncing and be the wrong level.  Waiting it out until the
bouncing is finished does not have this window for error.

- -Andy
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org


More information about the openmoko-kernel mailing list