Skip to content

Commit fe0a530

Browse files
oder-chioubroonie
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent b3df80a commit fe0a530

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sound/soc/codecs/rt5682.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1082,7 +1082,8 @@ void rt5682_jack_detect_handler(struct work_struct *work)
10821082
/* jack was out, report jack type */
10831083
rt5682->jack_type =
10841084
rt5682_headset_detect(rt5682->component, 1);
1085-
} else {
1085+
} else if ((rt5682->jack_type & SND_JACK_HEADSET) ==
1086+
SND_JACK_HEADSET) {
10861087
/* jack is already in, report button event */
10871088
rt5682->jack_type = SND_JACK_HEADSET;
10881089
btn_type = rt5682_button_detect(rt5682->component);

0 commit comments

Comments
 (0)