ASoC: Convert H1940 to table based init
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Sat, 8 Oct 2011 12:30:06 +0000 (13:30 +0100)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 10 Oct 2011 10:07:26 +0000 (11:07 +0100)
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Sangbeom Kim <sbkim73@samsung.com>
sound/soc/samsung/h1940_uda1380.c

index 52025c92f04c9158f0eec2e034274f6ee2d25c79..f75a4b60cf38a9909b2713d5b0df30fc2dd02dfd 100644 (file)
@@ -182,18 +182,6 @@ static int h1940_uda1380_init(struct snd_soc_pcm_runtime *rtd)
        struct snd_soc_dapm_context *dapm = &codec->dapm;
        int err;
 
-       /* Add h1940 specific widgets */
-       err = snd_soc_dapm_new_controls(dapm, uda1380_dapm_widgets,
-                                 ARRAY_SIZE(uda1380_dapm_widgets));
-       if (err)
-               return err;
-
-       /* Set up h1940 specific audio path audio_mapnects */
-       err = snd_soc_dapm_add_routes(dapm, audio_map,
-                                     ARRAY_SIZE(audio_map));
-       if (err)
-               return err;
-
        snd_soc_dapm_enable_pin(dapm, "Headphone Jack");
        snd_soc_dapm_enable_pin(dapm, "Speaker");
        snd_soc_dapm_enable_pin(dapm, "Mic Jack");
@@ -228,6 +216,11 @@ static struct snd_soc_card h1940_asoc = {
        .name = "h1940",
        .dai_link = h1940_uda1380_dai,
        .num_links = ARRAY_SIZE(h1940_uda1380_dai),
+
+       .dapm_widgets = uda1380_dapm_widgets,
+       .num_dapm_widgets = ARRAY_SIZE(uda1380_dapm_widgets),
+       .dapm_routes = audio_map,
+       .num_dapm_routes = ARRAY_SIZE(audio_map),
 };
 
 static int __init h1940_init(void)