aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/pxa
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2011-12-30 19:44:04 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-01-02 08:08:37 -0500
commit7c27426356c185ac9f8af8c77889b51d1442a2ac (patch)
treee3e0b3b38d1184368c7b1699116669e6e1230548 /sound/soc/pxa
parent38b437be0b16517c8b6db66d82d63f5c20927116 (diff)
ASoC: Convert spitz 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/spitz.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/sound/soc/pxa/spitz.c b/sound/soc/pxa/spitz.c
index 76288ad905e2..90c5245c4742 100644
--- a/sound/soc/pxa/spitz.c
+++ b/sound/soc/pxa/spitz.c
@@ -222,7 +222,7 @@ static const struct snd_soc_dapm_widget wm8750_dapm_widgets[] = {
222}; 222};
223 223
224/* Spitz machine audio_map */ 224/* Spitz machine audio_map */
225static const struct snd_soc_dapm_route audio_map[] = { 225static const struct snd_soc_dapm_route spitz_audio_map[] = {
226 226
227 /* headphone connected to LOUT1, ROUT1 */ 227 /* headphone connected to LOUT1, ROUT1 */
228 {"Headphone Jack", NULL, "LOUT1"}, 228 {"Headphone Jack", NULL, "LOUT1"},
@@ -265,7 +265,6 @@ static int spitz_wm8750_init(struct snd_soc_pcm_runtime *rtd)
265{ 265{
266 struct snd_soc_codec *codec = rtd->codec; 266 struct snd_soc_codec *codec = rtd->codec;
267 struct snd_soc_dapm_context *dapm = &codec->dapm; 267 struct snd_soc_dapm_context *dapm = &codec->dapm;
268 int err;
269 268
270 /* NC codec pins */ 269 /* NC codec pins */
271 snd_soc_dapm_nc_pin(dapm, "RINPUT1"); 270 snd_soc_dapm_nc_pin(dapm, "RINPUT1");
@@ -276,19 +275,6 @@ static int spitz_wm8750_init(struct snd_soc_pcm_runtime *rtd)
276 snd_soc_dapm_nc_pin(dapm, "OUT3"); 275 snd_soc_dapm_nc_pin(dapm, "OUT3");
277 snd_soc_dapm_nc_pin(dapm, "MONO1"); 276 snd_soc_dapm_nc_pin(dapm, "MONO1");
278 277
279 /* Add spitz specific controls */
280 err = snd_soc_add_controls(codec, wm8750_spitz_controls,
281 ARRAY_SIZE(wm8750_spitz_controls));
282 if (err < 0)
283 return err;
284
285 /* Add spitz specific widgets */
286 snd_soc_dapm_new_controls(dapm, wm8750_dapm_widgets,
287 ARRAY_SIZE(wm8750_dapm_widgets));
288
289 /* Set up spitz specific audio paths */
290 snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
291
292 return 0; 278 return 0;
293} 279}
294 280
@@ -312,6 +298,13 @@ static struct snd_soc_card snd_soc_spitz = {
312 .owner = THIS_MODULE, 298 .owner = THIS_MODULE,
313 .dai_link = &spitz_dai, 299 .dai_link = &spitz_dai,
314 .num_links = 1, 300 .num_links = 1,
301
302 .controls = wm8750_spitz_controls,
303 .num_controls = ARRAY_SIZE(wm8750_spitz_controls),
304 .dapm_widgets = wm8750_dapm_widgets,
305 .num_dapm_widgets = ARRAY_SIZE(wm8750_dapm_widgets),
306 .dapm_routes = spitz_audio_map,
307 .num_dapm_routes = ARRAY_SIZE(spitz_audio_map),
315}; 308};
316 309
317static struct platform_device *spitz_snd_device; 310static struct platform_device *spitz_snd_device;