diff options
author | Oder Chiou <oder_chiou@realtek.com> | 2020-07-16 06:01:23 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2020-07-16 22:29:09 +0300 |
commit | fe0a53044b4bce947045eadd7fa1adbc4685afab (patch) | |
tree | 536b7fb25c4538383a06a01b0d1c85e161da506f /sound/soc/codecs/rt5682.c | |
parent | b3df80ab6d147d4738be242e1c91e5fdbb6b03ef (diff) | |
download | linux-fe0a53044b4bce947045eadd7fa1adbc4685afab.tar.xz |
ASoC: rt5682: Report the button event in the headset type only
The irq work will be manipulated by resume function, and it will report
the wrong jack type while the jack type is headphone in the button event.
Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Link: https://lore.kernel.org/r/20200716030123.27122-1-oder_chiou@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/rt5682.c')
-rw-r--r-- | sound/soc/codecs/rt5682.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/soc/codecs/rt5682.c b/sound/soc/codecs/rt5682.c index 5adfaf3a7134..d503b5bef4ba 100644 --- a/sound/soc/codecs/rt5682.c +++ b/sound/soc/codecs/rt5682.c @@ -1082,7 +1082,8 @@ void rt5682_jack_detect_handler(struct work_struct *work) /* jack was out, report jack type */ rt5682->jack_type = rt5682_headset_detect(rt5682->component, 1); - } else { + } else if ((rt5682->jack_type & SND_JACK_HEADSET) == + SND_JACK_HEADSET) { /* jack is already in, report button event */ rt5682->jack_type = SND_JACK_HEADSET; btn_type = rt5682_button_detect(rt5682->component); |