]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - sound/soc/pxa/spitz.c
Merge branch 'origin' into devel
[linux-2.6-omap-h63xx.git] / sound / soc / pxa / spitz.c
index a3b9e6bdf9794cb1350d34448efeddbee1989591..c4cd2acaacb47a239ffd5cad78d304dc8987012c 100644 (file)
@@ -26,8 +26,6 @@
 #include <sound/soc-dapm.h>
 
 #include <asm/mach-types.h>
-#include <mach/pxa-regs.h>
-#include <mach/hardware.h>
 #include <mach/spitz.h>
 #include "../codecs/wm8750.h"
 #include "pxa2xx-pcm.h"
@@ -109,7 +107,7 @@ static void spitz_ext_control(struct snd_soc_codec *codec)
 static int spitz_startup(struct snd_pcm_substream *substream)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
-       struct snd_soc_codec *codec = rtd->socdev->codec;
+       struct snd_soc_codec *codec = rtd->socdev->card->codec;
 
        /* check the jack status at stream startup */
        spitz_ext_control(codec);
@@ -278,7 +276,7 @@ static const struct snd_kcontrol_new wm8750_spitz_controls[] = {
  */
 static int spitz_wm8750_init(struct snd_soc_codec *codec)
 {
-       int i, err;
+       int err;
 
        /* NC codec pins */
        snd_soc_dapm_nc_pin(codec, "RINPUT1");
@@ -290,12 +288,10 @@ static int spitz_wm8750_init(struct snd_soc_codec *codec)
        snd_soc_dapm_nc_pin(codec, "MONO1");
 
        /* Add spitz specific controls */
-       for (i = 0; i < ARRAY_SIZE(wm8750_spitz_controls); i++) {
-               err = snd_ctl_add(codec->card,
-                       snd_soc_cnew(&wm8750_spitz_controls[i], codec, NULL));
-               if (err < 0)
-                       return err;
-       }
+       err = snd_soc_add_controls(codec, wm8750_spitz_controls,
+                               ARRAY_SIZE(wm8750_spitz_controls));
+       if (err < 0)
+               return err;
 
        /* Add spitz specific widgets */
        snd_soc_dapm_new_controls(codec, wm8750_dapm_widgets,