ASoC: wm5100: Make sure we switch to button reporting mode
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Wed, 25 Jan 2012 15:19:20 +0000 (15:19 +0000)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Wed, 25 Jan 2012 15:35:40 +0000 (15:35 +0000)
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>
sound/soc/codecs/wm5100.c

index 66f0611e68b6e8efdae0234eee5ed6fd8748d3b4..3f8fd3ca9454e47ef9ab1aecd5906436e33ff7ae 100644 (file)
@@ -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);
@@ -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);