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

index 6db4e554ea039fd1fbc868cc20e9c996b987a7b8..6ac6bc2bcc4e4c571850209bcdb45278c4a31b56 100644 (file)
@@ -153,20 +153,6 @@ static int smartq_wm8987_init(struct snd_soc_pcm_runtime *rtd)
        struct snd_soc_dapm_context *dapm = &codec->dapm;
        int err = 0;
 
-       /* Add SmartQ specific widgets */
-       snd_soc_dapm_new_controls(dapm, wm8987_dapm_widgets,
-                                 ARRAY_SIZE(wm8987_dapm_widgets));
-
-       /* add SmartQ specific controls */
-       err = snd_soc_add_controls(codec, wm8987_smartq_controls,
-                                  ARRAY_SIZE(wm8987_smartq_controls));
-
-       if (err < 0)
-               return err;
-
-       /* setup SmartQ specific audio path */
-       snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
-
        /* set endpoints to not connected */
        snd_soc_dapm_nc_pin(dapm, "LINPUT1");
        snd_soc_dapm_nc_pin(dapm, "RINPUT1");
@@ -213,6 +199,13 @@ static struct snd_soc_card snd_soc_smartq = {
        .name = "SmartQ",
        .dai_link = smartq_dai,
        .num_links = ARRAY_SIZE(smartq_dai),
+
+       .dapm_widgets = wm8987_dapm_widgets,
+       .num_dapm_widgets = ARRAY_SIZE(wm8987_dapm_widgets),
+       .dapm_routes = audio_map,
+       .num_dapm_routes = ARRAY_SIZE(audio_map),
+       .controls = wm8987_smartq_controls,
+       .num_controls = ARRAY_SIZE(wm8987_smartq_controls),
 };
 
 static struct platform_device *smartq_snd_device;