ASoC: dmic: Convert table based DAPM setup
authorLars-Peter Clausen <lars@metafoo.de>
Tue, 27 Aug 2013 13:50:55 +0000 (15:50 +0200)
committerMark Brown <broonie@linaro.org>
Tue, 27 Aug 2013 14:31:58 +0000 (15:31 +0100)
Let the core take care of instantiating the DAPM widgets and routes, this makes
the code a bit shorter.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
sound/soc/codecs/dmic.c

index 66967ba6f7576c8f1fc816bb7e894f3e7799e3a2..b2090b2a5e2d9fb9e4aa24459f73075788bb8dc8 100644 (file)
@@ -50,20 +50,11 @@ static const struct snd_soc_dapm_route intercon[] = {
        {"DMIC AIF", NULL, "DMic"},
 };
 
-static int dmic_probe(struct snd_soc_codec *codec)
-{
-       struct snd_soc_dapm_context *dapm = &codec->dapm;
-
-       snd_soc_dapm_new_controls(dapm, dmic_dapm_widgets,
-                                 ARRAY_SIZE(dmic_dapm_widgets));
-        snd_soc_dapm_add_routes(dapm, intercon, ARRAY_SIZE(intercon));
-       snd_soc_dapm_new_widgets(dapm);
-
-       return 0;
-}
-
 static struct snd_soc_codec_driver soc_dmic = {
-       .probe  = dmic_probe,
+       .dapm_widgets = dmic_dapm_widgets,
+       .num_dapm_widgets = ARRAY_SIZE(dmic_dapm_widgets),
+       .dapm_routes = intercon,
+       .num_dapm_routes = ARRAY_SIZE(intercon),
 };
 
 static int dmic_dev_probe(struct platform_device *pdev)