[ALSA] soc - eti_b1_wm8731 - Convert to use bulk DAPM control registration
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Tue, 13 May 2008 12:57:37 +0000 (14:57 +0200)
committerJaroslav Kysela <perex@perex.cz>
Mon, 19 May 2008 11:19:18 +0000 (13:19 +0200)
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Frank Mandarino <fmandarino@endrelia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
sound/soc/at91/eti_b1_wm8731.c

index 1347dcf3f80b822a300e522d93abbdd2e6ea3202..4a383a4a0ff127381eb97ee3969b330a4e46e4f2 100644 (file)
@@ -191,7 +191,7 @@ static const struct snd_soc_dapm_widget eti_b1_dapm_widgets[] = {
        SND_SOC_DAPM_SPK("Ext Spk", NULL),
 };
 
-static const char *intercon[][3] = {
+static const struct snd_soc_dapm_route intercon[] = {
 
        /* speaker connected to LHPOUT */
        {"Ext Spk", NULL, "LHPOUT"},
@@ -199,9 +199,6 @@ static const char *intercon[][3] = {
        /* mic is connected to Mic Jack, with WM8731 Mic Bias */
        {"MICIN", NULL, "Mic Bias"},
        {"Mic Bias", NULL, "Int Mic"},
-
-       /* terminator */
-       {NULL, NULL, NULL},
 };
 
 /*
@@ -209,20 +206,14 @@ static const char *intercon[][3] = {
  */
 static int eti_b1_wm8731_init(struct snd_soc_codec *codec)
 {
-       int i;
-
        DBG("eti_b1_wm8731_init() called\n");
 
        /* Add specific widgets */
-       for(i = 0; i < ARRAY_SIZE(eti_b1_dapm_widgets); i++) {
-               snd_soc_dapm_new_control(codec, &eti_b1_dapm_widgets[i]);
-       }
+       snd_soc_dapm_new_controls(codec, eti_b1_dapm_widgets,
+                                 ARRAY_SIZE(eti_b1_dapm_widgets));
 
        /* Set up specific audio path interconnects */
-       for(i = 0; intercon[i][0] != NULL; i++) {
-               snd_soc_dapm_connect_input(codec, intercon[i][0],
-                       intercon[i][1], intercon[i][2]);
-       }
+       snd_soc_dapm_add_route(codec, intercon, ARRAY_SIZE(intercon));
 
        /* not connected */
        snd_soc_dapm_set_endpoint(codec, "RLINEIN", 0);