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

Liam Girdwood lrg at slimlogic.co.uk
Sun Oct 10 12:38:57 CEST 2010


On Thu, 2010-10-07 at 08:54 +0300, Jarkko Nikula wrote:
> 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>

Acked-by: Liam Girdwood <lrg at slimlogic.co.uk>
-- 
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk



More information about the Alsa-devel mailing list