diff options
author | Paul Kocialkowski <contact@paulk.fr> | 2014-05-11 11:51:36 +0200 |
---|---|---|
committer | Paul Kocialkowski <contact@paulk.fr> | 2014-05-11 11:51:36 +0200 |
commit | 6a93c9be394d42c085811b85cefa3284511533a4 (patch) | |
tree | 4f8f747309917e86b8fd2cd3a63ccc28c2793893 /sound | |
parent | bdb7dbfe8039225429584f294233a909daedf69f (diff) | |
download | kernel_goldelico_gta04-6a93c9be394d42c085811b85cefa3284511533a4.zip kernel_goldelico_gta04-6a93c9be394d42c085811b85cefa3284511533a4.tar.gz kernel_goldelico_gta04-6a93c9be394d42c085811b85cefa3284511533a4.tar.bz2 |
gta04-audio: Wait for two consecutive button press values to report
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/omap/gta04-audio.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sound/soc/omap/gta04-audio.c b/sound/soc/omap/gta04-audio.c index 187372b..ecf4b5c 100644 --- a/sound/soc/omap/gta04-audio.c +++ b/sound/soc/omap/gta04-audio.c @@ -179,9 +179,12 @@ static void gta04_audio_jack_work(struct work_struct *work) } else if (jack.present & SND_JACK_MICROPHONE && jack.reliable) { jackbits = jack.present; - if (val > jack.short_threshold) - jackbits |= SND_JACK_BTN_0; - + if (val > jack.short_threshold) { + jack.present |= SND_JACK_BTN_0; + } else if (jack.present & SND_JACK_BTN_0) { + jack.present &= ~(SND_JACK_BTN_0); + jackbits = jack.present; + } delay = msecs_to_jiffies(50); } else if (!jack.present || !jack.reliable) { if (val > jack.short_threshold) |