Skip to content

Commit

Permalink
ASoC: rt5682: Report the button event in the headset type only
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Oder Chiou authored and Mark Brown committed Jul 16, 2020
1 parent b3df80a commit fe0a530
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sound/soc/codecs/rt5682.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit fe0a530

Please sign in to comment.