aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2014-03-08 09:47:22 -0500
committerMark Brown <broonie@linaro.org>2014-03-10 06:31:43 -0400
commitb0ffe9b1ab8705eeffa72feacd791ab6fdd2a06c (patch)
tree943dab32a1213d73f6ee8cdceb66e554486d1164
parenta69d0009aad51e16bf294d78a3b2e4fe655cf10f (diff)
ASoC: sam9g20_wm8731: Convert to table based DAPM setup
Use table based setup to register the DAPM widgets and routes. This on one hand makes the code a bit shorter and cleaner and on the other hand the board level DAPM elements get registered in the card's DAPM context rather than in the CODEC's DAPM context. While we are at it also remove the snd_soc_dapm_enable_pin() in the init callback. Pins are enabled by default. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Tested-by: Bo Shen <voice.shen@atmel.com> Acked-by: Bo Shen <voice.shen@atmel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r--sound/soc/atmel/sam9g20_wm8731.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/sound/soc/atmel/sam9g20_wm8731.c b/sound/soc/atmel/sam9g20_wm8731.c
index f15bff1548f8..174bd546c08b 100644
--- a/sound/soc/atmel/sam9g20_wm8731.c
+++ b/sound/soc/atmel/sam9g20_wm8731.c
@@ -155,25 +155,14 @@ static int at91sam9g20ek_wm8731_init(struct snd_soc_pcm_runtime *rtd)
155 return ret; 155 return ret;
156 } 156 }
157 157
158 /* Add specific widgets */
159 snd_soc_dapm_new_controls(dapm, at91sam9g20ek_dapm_widgets,
160 ARRAY_SIZE(at91sam9g20ek_dapm_widgets));
161 /* Set up specific audio path interconnects */
162 snd_soc_dapm_add_routes(dapm, intercon, ARRAY_SIZE(intercon));
163
164 /* not connected */ 158 /* not connected */
165 snd_soc_dapm_nc_pin(dapm, "RLINEIN"); 159 snd_soc_dapm_nc_pin(dapm, "RLINEIN");
166 snd_soc_dapm_nc_pin(dapm, "LLINEIN"); 160 snd_soc_dapm_nc_pin(dapm, "LLINEIN");
167 161
168#ifdef ENABLE_MIC_INPUT 162#ifndef ENABLE_MIC_INPUT
169 snd_soc_dapm_enable_pin(dapm, "Int Mic"); 163 snd_soc_dapm_nc_pin(&rtd->card->dapm, "Int Mic");
170#else
171 snd_soc_dapm_nc_pin(dapm, "Int Mic");
172#endif 164#endif
173 165
174 /* always connected */
175 snd_soc_dapm_enable_pin(dapm, "Ext Spk");
176
177 return 0; 166 return 0;
178} 167}
179 168
@@ -194,6 +183,11 @@ static struct snd_soc_card snd_soc_at91sam9g20ek = {
194 .dai_link = &at91sam9g20ek_dai, 183 .dai_link = &at91sam9g20ek_dai,
195 .num_links = 1, 184 .num_links = 1,
196 .set_bias_level = at91sam9g20ek_set_bias_level, 185 .set_bias_level = at91sam9g20ek_set_bias_level,
186
187 .dapm_widgets = at91sam9g20ek_dapm_widgets,
188 .num_dapm_widgets = ARRAY_SIZE(at91sam9g20ek_dapm_widgets),
189 .dapm_routes = intercon,
190 .num_dapm_routes = ARRAY_SIZE(intercon),
197}; 191};
198 192
199static int at91sam9g20ek_audio_probe(struct platform_device *pdev) 193static int at91sam9g20ek_audio_probe(struct platform_device *pdev)