Merge remote-tracking branches 'asoc/topic/rl6231', 'asoc/topic/rl6347a', 'asoc/topic...
authorMark Brown <broonie@kernel.org>
Mon, 12 Dec 2016 15:53:11 +0000 (15:53 +0000)
committerMark Brown <broonie@kernel.org>
Mon, 12 Dec 2016 15:53:11 +0000 (15:53 +0000)
1  2  3  4  5  6 
sound/soc/codecs/Kconfig
sound/soc/codecs/rt298.c

Simple merge
index 2db8179047ae89b4d2b297e5588bd8e77b3ab235,55558643166fda708ccb781daffcc9ed40806bc2,55558643166fda708ccb781daffcc9ed40806bc2,55558643166fda708ccb781daffcc9ed40806bc2,55558643166fda708ccb781daffcc9ed40806bc2,6c4ac5b04665c482a29550c5bf1249d3784ff6cf..7150a407ffd9d9e8590e83a9673d36781cf76bf1
@@@@@@@ -326,11 -321,11 -321,11 -321,11 -321,11 -321,31 +326,31 @@@@@@@ static void rt298_jack_detect_work(stru
      int rt298_mic_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack)
      {
        struct rt298_priv *rt298 = snd_soc_codec_get_drvdata(codec);
+++++   struct snd_soc_dapm_context *dapm;
+++++   bool hp = false;
+++++   bool mic = false;
+++++   int status = 0;
+++++ 
+++++   /* If jack in NULL, disable HS jack */
+++++   if (!jack) {
+++++           regmap_update_bits(rt298->regmap, RT298_IRQ_CTRL, 0x2, 0x0);
+++++           dapm = snd_soc_codec_get_dapm(codec);
+++++           snd_soc_dapm_disable_pin(dapm, "LDO1");
+++++           snd_soc_dapm_sync(dapm);
+++++           return 0;
+++++   }
      
        rt298->jack = jack;
-       /* Send an initial empty report */
-       snd_soc_jack_report(rt298->jack, 0,
+++++   regmap_update_bits(rt298->regmap, RT298_IRQ_CTRL, 0x2, 0x2);
 ++++ 
 ----   /* Send an initial empty report */
 ----   snd_soc_jack_report(rt298->jack, 0,
+++++   rt298_jack_detect(rt298, &hp, &mic);
+++++   if (hp == true)
+++++           status |= SND_JACK_HEADPHONE;
+     
+++++   if (mic == true)
+++++           status |= SND_JACK_MICROPHONE;
+++++ 
+++++   snd_soc_jack_report(rt298->jack, status,
                SND_JACK_MICROPHONE | SND_JACK_HEADPHONE);
      
        return 0;