[alsa-devel] [PATCH] ASoC: Jack: add configurable option for irq_flag

Mark Brown broonie at opensource.wolfsonmicro.com
Fri Feb 15 13:17:27 CET 2013

On Fri, Feb 15, 2013 at 12:40:00PM +0530, Omair M. Abdullah wrote:

> This patch is mainly to handle GPIOs where there is some toggling of the GPIO
> lines due to the switch bouncing, and the debounce time cannot be increased
> further due to other constraints. In such cases, providing the specific
> edge on which to trigger the interrupt helps increase the robustness.

>      ___   _                _   _________
> e.g.    |_| |______________| |_|

> insert followed by removal, where we want to trigger on the falling edge in both
> cases.

This doesn't make much sense to me, it's a *very* non-obvious change and
it doesn't reflect what's actually happening well.  If you happen to be
lucky and get no bounce it'll fail.  If it's working on your system
there is a fair element of luck in there.

It sounds like all you're looking for here is a better debounce
algorithm, for example one that delays for a bit then starts polling the
GPIO state at a higher rate and declares a result when the GPIO state
doesn't change for a few polls.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20130215/85f88585/attachment.sig>

More information about the Alsa-devel mailing list