[alsa-devel] [PATCH] ASoC: Use delayed work for debounce of GPIO based jacks

Jarkko Nikula jhnikula at gmail.com
Thu Oct 7 07:54:31 CEST 2010


On Wed,  6 Oct 2010 16:05:01 -0700
Mark Brown <broonie at opensource.wolfsonmicro.com> wrote:

> Rather than block the workqueue by sleeping to do the debounce use delayed
> work to implement the debounce time. This should also mean that we extend
> the debounce time on each new bounce, potentially allowing shorter debounce
> times for clean insertions.
> 
> Signed-off-by: Mark Brown <broonie at opensource.wolfsonmicro.com>
> ---
> 
> This is completely untested as I do not have any systems to hand which
> can make use of this functionality but I believe it should work - I've
> CCed a couple of the OMAP people since they seem to be the main users.
> 
>  include/sound/soc.h  |    2 +-
>  sound/soc/soc-jack.c |   11 +++++------
>  2 files changed, 6 insertions(+), 7 deletions(-)
> 
Works fine on N900 when testing with
hexdump /dev/input/by-path/platform-soc-audio-event

I have a vague memory that user space and actual state can get soon out
of sync if using delay based debouncing only and doing some insane plug
in/out cycle. So this is a step to right direction for implementing
more advanced debouncing.

Acked-by: Jarkko Nikula <jhnikula at gmail.com>


More information about the Alsa-devel mailing list