ALSA: ASoC: Pass the DAI being configured into CPU DAI probe and remove
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Wed, 11 Jun 2008 12:47:10 +0000 (13:47 +0100)
committerJaroslav Kysela <perex@perex.cz>
Fri, 13 Jun 2008 14:48:01 +0000 (16:48 +0200)
This allows per-DAI initialisation to be done by the CPU DAI drivers.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
include/sound/soc.h
sound/soc/davinci/davinci-i2s.c
sound/soc/pxa/pxa2xx-ac97.c
sound/soc/s3c24xx/s3c2412-i2s.c
sound/soc/s3c24xx/s3c2443-ac97.c
sound/soc/s3c24xx/s3c24xx-i2s.c
sound/soc/soc-core.c

index 9fa2093e74ebd03ddf941ec729fa98b86f7321a5..56d2224c2c07fd2365149bcec132a3bacdcf6554 100644 (file)
@@ -358,8 +358,10 @@ struct snd_soc_cpu_dai {
        unsigned char type;
 
        /* DAI callbacks */
-       int (*probe)(struct platform_device *pdev);
-       void (*remove)(struct platform_device *pdev);
+       int (*probe)(struct platform_device *pdev,
+                    struct snd_soc_cpu_dai *dai);
+       void (*remove)(struct platform_device *pdev,
+                      struct snd_soc_cpu_dai *dai);
        int (*suspend)(struct platform_device *pdev,
                struct snd_soc_cpu_dai *cpu_dai);
        int (*resume)(struct platform_device *pdev,
index c421774b33ee9b58d9705ada66e546bd4ba9fce9..c3b545ccff723c88dc46b08940cf3277bb8840f8 100644 (file)
@@ -295,7 +295,8 @@ static int davinci_i2s_trigger(struct snd_pcm_substream *substream, int cmd)
        return ret;
 }
 
-static int davinci_i2s_probe(struct platform_device *pdev)
+static int davinci_i2s_probe(struct platform_device *pdev,
+                            struct snd_soc_cpu_dai *dai)
 {
        struct snd_soc_device *socdev = platform_get_drvdata(pdev);
        struct snd_soc_machine *machine = socdev->machine;
@@ -356,7 +357,8 @@ err_release_region:
        return ret;
 }
 
-static void davinci_i2s_remove(struct platform_device *pdev)
+static void davinci_i2s_remove(struct platform_device *pdev,
+                              struct snd_soc_cpu_dai *dai)
 {
        struct snd_soc_device *socdev = platform_get_drvdata(pdev);
        struct snd_soc_machine *machine = socdev->machine;
index 97ec2d90547c30e64a177f9f250168d02073d6c0..cb947956ed1a2267b9d22138b2c58dd01c2d6840 100644 (file)
@@ -310,7 +310,8 @@ static int pxa2xx_ac97_resume(struct platform_device *pdev,
 #define pxa2xx_ac97_resume     NULL
 #endif
 
-static int pxa2xx_ac97_probe(struct platform_device *pdev)
+static int pxa2xx_ac97_probe(struct platform_device *pdev,
+                            struct snd_soc_cpu_dai *dai)
 {
        int ret;
 
index c4a46dd589b3b1565f6c3d2e450465a3a4c6744b..c463a82dec3a87a76cb0c7b96c88b3f66ca23599 100644 (file)
@@ -601,7 +601,8 @@ struct clk *s3c2412_get_iisclk(void)
 EXPORT_SYMBOL_GPL(s3c2412_get_iisclk);
 
 
-static int s3c2412_i2s_probe(struct platform_device *pdev)
+static int s3c2412_i2s_probe(struct platform_device *pdev,
+                            struct snd_soc_cpu_dai *dai)
 {
        DBG("Entered %s\n", __func__);
 
index 0eed140dcd9bc6582ef0982a2c0e46d7b8ac5102..533565b61b2f720843948210696c22311c7ad4c6 100644 (file)
@@ -209,7 +209,8 @@ static struct s3c24xx_pcm_dma_params s3c2443_ac97_mic_mono_in = {
        .dma_size       = 4,
 };
 
-static int s3c2443_ac97_probe(struct platform_device *pdev)
+static int s3c2443_ac97_probe(struct platform_device *pdev,
+                             struct snd_soc_cpu_dai *dai)
 {
        int ret;
        u32 ac_glbctrl;
@@ -260,7 +261,8 @@ static int s3c2443_ac97_probe(struct platform_device *pdev)
        return ret;
 }
 
-static void s3c2443_ac97_remove(struct platform_device *pdev)
+static void s3c2443_ac97_remove(struct platform_device *pdev,
+                               struct snd_soc_cpu_dai *dai)
 {
        free_irq(IRQ_S3C244x_AC97, NULL);
        clk_disable(s3c24xx_ac97.ac97_clk);
index 4c52f7946d9e21b87d150dec3d69fce4eadd3cf5..42e96b5ff825197eeb47a02f36e2c918b07a50bc 100644 (file)
@@ -377,7 +377,8 @@ u32 s3c24xx_i2s_get_clockrate(void)
 }
 EXPORT_SYMBOL_GPL(s3c24xx_i2s_get_clockrate);
 
-static int s3c24xx_i2s_probe(struct platform_device *pdev)
+static int s3c24xx_i2s_probe(struct platform_device *pdev,
+                            struct snd_soc_cpu_dai *dai)
 {
        DBG("Entered %s\n", __func__);
 
index f594ab888e17b611766ad61cd9937dbb73c5d76a..c96a6184d66eccfcf1bc31bd650c92db8bee2b7b 100644 (file)
@@ -768,7 +768,7 @@ static int soc_probe(struct platform_device *pdev)
        for (i = 0; i < machine->num_links; i++) {
                struct snd_soc_cpu_dai *cpu_dai = machine->dai_link[i].cpu_dai;
                if (cpu_dai->probe) {
-                       ret = cpu_dai->probe(pdev);
+                       ret = cpu_dai->probe(pdev, cpu_dai);
                        if (ret < 0)
                                goto cpu_dai_err;
                }
@@ -798,7 +798,7 @@ cpu_dai_err:
        for (i--; i >= 0; i--) {
                struct snd_soc_cpu_dai *cpu_dai = machine->dai_link[i].cpu_dai;
                if (cpu_dai->remove)
-                       cpu_dai->remove(pdev);
+                       cpu_dai->remove(pdev, cpu_dai);
        }
 
        if (machine->remove)
@@ -827,7 +827,7 @@ static int soc_remove(struct platform_device *pdev)
        for (i = 0; i < machine->num_links; i++) {
                struct snd_soc_cpu_dai *cpu_dai = machine->dai_link[i].cpu_dai;
                if (cpu_dai->remove)
-                       cpu_dai->remove(pdev);
+                       cpu_dai->remove(pdev, cpu_dai);
        }
 
        if (machine->remove)