ASoC: twl6040: Add ramp up/down volume for HS and HF
[deliverable/linux.git] / sound / soc / atmel / sam9g20_wm8731.c
index 293569dfd0edec6d70551d90e610a93bba74ad7f..af3c73053ee4f55f58a2e35888761e71396f2e6d 100644 (file)
@@ -44,7 +44,6 @@
 #include <sound/pcm.h>
 #include <sound/pcm_params.h>
 #include <sound/soc.h>
-#include <sound/soc-dapm.h>
 
 #include <asm/mach-types.h>
 #include <mach/hardware.h>
@@ -140,6 +139,7 @@ static int at91sam9g20ek_wm8731_init(struct snd_soc_pcm_runtime *rtd)
 {
        struct snd_soc_codec *codec = rtd->codec;
        struct snd_soc_dai *codec_dai = rtd->codec_dai;
+       struct snd_soc_dapm_context *dapm = &codec->dapm;
        int ret;
 
        printk(KERN_DEBUG
@@ -154,25 +154,25 @@ static int at91sam9g20ek_wm8731_init(struct snd_soc_pcm_runtime *rtd)
        }
 
        /* Add specific widgets */
-       snd_soc_dapm_new_controls(codec, at91sam9g20ek_dapm_widgets,
+       snd_soc_dapm_new_controls(dapm, at91sam9g20ek_dapm_widgets,
                                  ARRAY_SIZE(at91sam9g20ek_dapm_widgets));
        /* Set up specific audio path interconnects */
-       snd_soc_dapm_add_routes(codec, intercon, ARRAY_SIZE(intercon));
+       snd_soc_dapm_add_routes(dapm, intercon, ARRAY_SIZE(intercon));
 
        /* not connected */
-       snd_soc_dapm_nc_pin(codec, "RLINEIN");
-       snd_soc_dapm_nc_pin(codec, "LLINEIN");
+       snd_soc_dapm_nc_pin(dapm, "RLINEIN");
+       snd_soc_dapm_nc_pin(dapm, "LLINEIN");
 
 #ifdef ENABLE_MIC_INPUT
-       snd_soc_dapm_enable_pin(codec, "Int Mic");
+       snd_soc_dapm_enable_pin(dapm, "Int Mic");
 #else
-       snd_soc_dapm_nc_pin(codec, "Int Mic");
+       snd_soc_dapm_nc_pin(dapm, "Int Mic");
 #endif
 
        /* always connected */
-       snd_soc_dapm_enable_pin(codec, "Ext Spk");
+       snd_soc_dapm_enable_pin(dapm, "Ext Spk");
 
-       snd_soc_dapm_sync(codec);
+       snd_soc_dapm_sync(dapm);
 
        return 0;
 }
@@ -222,9 +222,9 @@ static int __init at91sam9g20ek_init(void)
        }
 
        pllb = clk_get(NULL, "pllb");
-       if (IS_ERR(mclk)) {
+       if (IS_ERR(pllb)) {
                printk(KERN_ERR "ASoC: Failed to get PLLB\n");
-               ret = PTR_ERR(mclk);
+               ret = PTR_ERR(pllb);
                goto err_mclk;
        }
        ret = clk_set_parent(mclk, pllb);
@@ -240,6 +240,7 @@ static int __init at91sam9g20ek_init(void)
        if (!at91sam9g20ek_snd_device) {
                printk(KERN_ERR "ASoC: Platform device allocation failed\n");
                ret = -ENOMEM;
+               goto err_mclk;
        }
 
        platform_set_drvdata(at91sam9g20ek_snd_device,
@@ -248,11 +249,13 @@ static int __init at91sam9g20ek_init(void)
        ret = platform_device_add(at91sam9g20ek_snd_device);
        if (ret) {
                printk(KERN_ERR "ASoC: Platform device allocation failed\n");
-               platform_device_put(at91sam9g20ek_snd_device);
+               goto err_device_add;
        }
 
        return ret;
 
+err_device_add:
+       platform_device_put(at91sam9g20ek_snd_device);
 err_mclk:
        clk_put(mclk);
        mclk = NULL;
This page took 0.029486 seconds and 5 git commands to generate.