aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/pxa
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2011-12-29 22:16:32 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-12-30 05:44:45 -0500
commit32696af13724aaf7651d1cf95bc1a7a8af97a5c8 (patch)
tree97d7ea60985b979eaabdcb9fb821df8b2b768926 /sound/soc/pxa
parent74f4dd56ffab34f280b83d18a5343ac96a7b91ad (diff)
ASoC: Convert corgi to table based DAPM and control init
Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/pxa')
-rw-r--r--sound/soc/pxa/corgi.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/sound/soc/pxa/corgi.c b/sound/soc/pxa/corgi.c
index 5ff6dac4794d..30ebce26dd9d 100644
--- a/sound/soc/pxa/corgi.c
+++ b/sound/soc/pxa/corgi.c
@@ -227,7 +227,7 @@ SND_SOC_DAPM_HP("Headset Jack", NULL),
227}; 227};
228 228
229/* Corgi machine audio map (connections to the codec pins) */ 229/* Corgi machine audio map (connections to the codec pins) */
230static const struct snd_soc_dapm_route audio_map[] = { 230static const struct snd_soc_dapm_route corgi_audio_map[] = {
231 231
232 /* headset Jack - in = micin, out = LHPOUT*/ 232 /* headset Jack - in = micin, out = LHPOUT*/
233 {"Headset Jack", NULL, "LHPOUT"}, 233 {"Headset Jack", NULL, "LHPOUT"},
@@ -269,24 +269,10 @@ static int corgi_wm8731_init(struct snd_soc_pcm_runtime *rtd)
269{ 269{
270 struct snd_soc_codec *codec = rtd->codec; 270 struct snd_soc_codec *codec = rtd->codec;
271 struct snd_soc_dapm_context *dapm = &codec->dapm; 271 struct snd_soc_dapm_context *dapm = &codec->dapm;
272 int err;
273 272
274 snd_soc_dapm_nc_pin(dapm, "LLINEIN"); 273 snd_soc_dapm_nc_pin(dapm, "LLINEIN");
275 snd_soc_dapm_nc_pin(dapm, "RLINEIN"); 274 snd_soc_dapm_nc_pin(dapm, "RLINEIN");
276 275
277 /* Add corgi specific controls */
278 err = snd_soc_add_controls(codec, wm8731_corgi_controls,
279 ARRAY_SIZE(wm8731_corgi_controls));
280 if (err < 0)
281 return err;
282
283 /* Add corgi specific widgets */
284 snd_soc_dapm_new_controls(dapm, wm8731_dapm_widgets,
285 ARRAY_SIZE(wm8731_dapm_widgets));
286
287 /* Set up corgi specific audio path audio_map */
288 snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
289
290 return 0; 276 return 0;
291} 277}
292 278
@@ -310,6 +296,13 @@ static struct snd_soc_card snd_soc_corgi = {
310 .owner = THIS_MODULE, 296 .owner = THIS_MODULE,
311 .dai_link = &corgi_dai, 297 .dai_link = &corgi_dai,
312 .num_links = 1, 298 .num_links = 1,
299
300 .controls = wm8731_corgi_controls,
301 .num_controls = ARRAY_SIZE(wm8731_corgi_controls),
302 .dapm_widgets = wm8731_dapm_widgets,
303 .num_dapm_widgets = ARRAY_SIZE(wm8731_dapm_widgets),
304 .dapm_routes = corgi_audio_map,
305 .num_dapm_routes = ARRAY_SIZE(corgi_audio_map),
313}; 306};
314 307
315static struct platform_device *corgi_snd_device; 308static struct platform_device *corgi_snd_device;