aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFang, Yang A <yang.a.fang@intel.com>2015-06-03 18:07:41 -0400
committerMark Brown <broonie@kernel.org>2015-06-15 05:51:36 -0400
commite8ed6702746650d09a6cb3fc89d979a92f1ed49b (patch)
treeb1b518824803ad4b4b54ad0e322b71c9e22949c9
parent6846e18a1e71360e76509f8d8235679a97b2437c (diff)
ASoC: Intel: fixed TI button detection
In order to make TI button interrupt working max98090 codec Need provide mic bias all the time as long as mic is present so SHDN and micbias pin are forced on.we also need set max98090 codec bias close or lower than TI bias.We set them in bios/coreboot kernel reads them from device property Signed-off-by: Fang, Yang A <yang.a.fang@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/intel/boards/cht_bsw_max98090_ti.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/sound/soc/intel/boards/cht_bsw_max98090_ti.c b/sound/soc/intel/boards/cht_bsw_max98090_ti.c
index 1be079423d1e..d604ee80eda4 100644
--- a/sound/soc/intel/boards/cht_bsw_max98090_ti.c
+++ b/sound/soc/intel/boards/cht_bsw_max98090_ti.c
@@ -101,6 +101,33 @@ static int cht_aif1_hw_params(struct snd_pcm_substream *substream,
101 return 0; 101 return 0;
102} 102}
103 103
104static int cht_ti_jack_event(struct notifier_block *nb,
105 unsigned long event, void *data)
106{
107
108 struct snd_soc_jack *jack = (struct snd_soc_jack *)data;
109 struct snd_soc_dai *codec_dai = jack->card->rtd->codec_dai;
110 struct snd_soc_codec *codec = codec_dai->codec;
111
112 if (event & SND_JACK_MICROPHONE) {
113
114 snd_soc_dapm_force_enable_pin(&codec->dapm, "SHDN");
115 snd_soc_dapm_force_enable_pin(&codec->dapm, "MICBIAS");
116 snd_soc_dapm_sync(&codec->dapm);
117 } else {
118
119 snd_soc_dapm_disable_pin(&codec->dapm, "MICBIAS");
120 snd_soc_dapm_disable_pin(&codec->dapm, "SHDN");
121 snd_soc_dapm_sync(&codec->dapm);
122 }
123
124 return 0;
125}
126
127static struct notifier_block cht_jack_nb = {
128 .notifier_call = cht_ti_jack_event,
129};
130
104static int cht_codec_init(struct snd_soc_pcm_runtime *runtime) 131static int cht_codec_init(struct snd_soc_pcm_runtime *runtime)
105{ 132{
106 int ret; 133 int ret;
@@ -130,6 +157,9 @@ static int cht_codec_init(struct snd_soc_pcm_runtime *runtime)
130 return ret; 157 return ret;
131 } 158 }
132 159
160 if (ctx->ts3a227e_present)
161 snd_soc_jack_notifier_register(jack, &cht_jack_nb);
162
133 return ret; 163 return ret;
134} 164}
135 165