Skip to content

Commit

Permalink
ASoC: wm5100: Make sure we switch to button reporting mode
Browse files Browse the repository at this point in the history
When we have identified an accessory make sure we've flagged that we've
done so in order to make sure we always report buttons and don't continue
to polarity flip.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Mark Brown committed Jan 25, 2012
1 parent c83f1d7 commit 9fb8352
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sound/soc/codecs/wm5100.c
Original file line number Diff line number Diff line change
Expand Up @@ -2183,6 +2183,7 @@ static void wm5100_micd_irq(struct snd_soc_codec *codec)
if (wm5100->jack_detecting) {
dev_dbg(codec->dev, "Microphone detected\n");
wm5100->jack_mic = true;
wm5100->jack_detecting = false;
snd_soc_jack_report(wm5100->jack,
SND_JACK_HEADSET,
SND_JACK_HEADSET | SND_JACK_BTN_0);
Expand Down Expand Up @@ -2221,6 +2222,7 @@ static void wm5100_micd_irq(struct snd_soc_codec *codec)
SND_JACK_BTN_0);
} else if (wm5100->jack_detecting) {
dev_dbg(codec->dev, "Headphone detected\n");
wm5100->jack_detecting = false;
snd_soc_jack_report(wm5100->jack, SND_JACK_HEADPHONE,
SND_JACK_HEADPHONE);

Expand Down

0 comments on commit 9fb8352

Please sign in to comment.