summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/rt5682.c
diff options
context:
space:
mode:
authorShuming Fan <shumingf@realtek.com>2021-03-09 11:58:27 +0300
committerMark Brown <broonie@kernel.org>2021-03-10 16:14:34 +0300
commit542712826f8d3b0a72e66d7feec2dedba5dfa297 (patch)
tree214276928c629086368b1fe43e9f29c736509f78 /sound/soc/codecs/rt5682.c
parentd59cfc6544dc19a1d1c1e47d95dd2150da3daf56 (diff)
downloadlinux-542712826f8d3b0a72e66d7feec2dedba5dfa297.tar.xz
ASoC: rt5682: add delay time of workqueue to control next IRQ event
This patch keeps the delay time (50 ms) for jack detection and zero delay time for the button press. This patch improves the reaction of the button press. Signed-off-by: Shuming Fan <shumingf@realtek.com> Link: https://lore.kernel.org/r/20210309085827.32032-1-shumingf@realtek.com Tested-by Curtis Malainey <cujomalainey@chromium.org> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/rt5682.c')
-rw-r--r--sound/soc/codecs/rt5682.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/soc/codecs/rt5682.c b/sound/soc/codecs/rt5682.c
index 559dc6db1f7c..0e2a10ed11da 100644
--- a/sound/soc/codecs/rt5682.c
+++ b/sound/soc/codecs/rt5682.c
@@ -1094,6 +1094,7 @@ void rt5682_jack_detect_handler(struct work_struct *work)
/* jack was out, report jack type */
rt5682->jack_type =
rt5682_headset_detect(rt5682->component, 1);
+ rt5682->irq_work_delay_time = 0;
} else if ((rt5682->jack_type & SND_JACK_HEADSET) ==
SND_JACK_HEADSET) {
/* jack is already in, report button event */
@@ -1139,6 +1140,7 @@ void rt5682_jack_detect_handler(struct work_struct *work)
} else {
/* jack out */
rt5682->jack_type = rt5682_headset_detect(rt5682->component, 0);
+ rt5682->irq_work_delay_time = 50;
}
snd_soc_jack_report(rt5682->hs_jack, rt5682->jack_type,