Commit bdb92876 authored by Mark Brown's avatar Mark Brown Committed by Jaroslav Kysela

ALSA: ASoC: Pass the DAI being configured into CPU DAI probe and remove

This allows per-DAI initialisation to be done by the CPU DAI drivers.
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarJaroslav Kysela <perex@perex.cz>
parent dbac7cb8
...@@ -358,8 +358,10 @@ struct snd_soc_cpu_dai { ...@@ -358,8 +358,10 @@ struct snd_soc_cpu_dai {
unsigned char type; unsigned char type;
/* DAI callbacks */ /* DAI callbacks */
int (*probe)(struct platform_device *pdev); int (*probe)(struct platform_device *pdev,
void (*remove)(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, int (*suspend)(struct platform_device *pdev,
struct snd_soc_cpu_dai *cpu_dai); struct snd_soc_cpu_dai *cpu_dai);
int (*resume)(struct platform_device *pdev, int (*resume)(struct platform_device *pdev,
......
...@@ -295,7 +295,8 @@ static int davinci_i2s_trigger(struct snd_pcm_substream *substream, int cmd) ...@@ -295,7 +295,8 @@ static int davinci_i2s_trigger(struct snd_pcm_substream *substream, int cmd)
return ret; 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_device *socdev = platform_get_drvdata(pdev);
struct snd_soc_machine *machine = socdev->machine; struct snd_soc_machine *machine = socdev->machine;
...@@ -356,7 +357,8 @@ err_release_region: ...@@ -356,7 +357,8 @@ err_release_region:
return ret; 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_device *socdev = platform_get_drvdata(pdev);
struct snd_soc_machine *machine = socdev->machine; struct snd_soc_machine *machine = socdev->machine;
......
...@@ -310,7 +310,8 @@ static int pxa2xx_ac97_resume(struct platform_device *pdev, ...@@ -310,7 +310,8 @@ static int pxa2xx_ac97_resume(struct platform_device *pdev,
#define pxa2xx_ac97_resume NULL #define pxa2xx_ac97_resume NULL
#endif #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; int ret;
......
...@@ -601,7 +601,8 @@ struct clk *s3c2412_get_iisclk(void) ...@@ -601,7 +601,8 @@ struct clk *s3c2412_get_iisclk(void)
EXPORT_SYMBOL_GPL(s3c2412_get_iisclk); 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__); DBG("Entered %s\n", __func__);
......
...@@ -209,7 +209,8 @@ static struct s3c24xx_pcm_dma_params s3c2443_ac97_mic_mono_in = { ...@@ -209,7 +209,8 @@ static struct s3c24xx_pcm_dma_params s3c2443_ac97_mic_mono_in = {
.dma_size = 4, .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; int ret;
u32 ac_glbctrl; u32 ac_glbctrl;
...@@ -260,7 +261,8 @@ static int s3c2443_ac97_probe(struct platform_device *pdev) ...@@ -260,7 +261,8 @@ static int s3c2443_ac97_probe(struct platform_device *pdev)
return ret; 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); free_irq(IRQ_S3C244x_AC97, NULL);
clk_disable(s3c24xx_ac97.ac97_clk); clk_disable(s3c24xx_ac97.ac97_clk);
......
...@@ -377,7 +377,8 @@ u32 s3c24xx_i2s_get_clockrate(void) ...@@ -377,7 +377,8 @@ u32 s3c24xx_i2s_get_clockrate(void)
} }
EXPORT_SYMBOL_GPL(s3c24xx_i2s_get_clockrate); 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__); DBG("Entered %s\n", __func__);
......
...@@ -768,7 +768,7 @@ static int soc_probe(struct platform_device *pdev) ...@@ -768,7 +768,7 @@ static int soc_probe(struct platform_device *pdev)
for (i = 0; i < machine->num_links; i++) { for (i = 0; i < machine->num_links; i++) {
struct snd_soc_cpu_dai *cpu_dai = machine->dai_link[i].cpu_dai; struct snd_soc_cpu_dai *cpu_dai = machine->dai_link[i].cpu_dai;
if (cpu_dai->probe) { if (cpu_dai->probe) {
ret = cpu_dai->probe(pdev); ret = cpu_dai->probe(pdev, cpu_dai);
if (ret < 0) if (ret < 0)
goto cpu_dai_err; goto cpu_dai_err;
} }
...@@ -798,7 +798,7 @@ cpu_dai_err: ...@@ -798,7 +798,7 @@ cpu_dai_err:
for (i--; i >= 0; i--) { for (i--; i >= 0; i--) {
struct snd_soc_cpu_dai *cpu_dai = machine->dai_link[i].cpu_dai; struct snd_soc_cpu_dai *cpu_dai = machine->dai_link[i].cpu_dai;
if (cpu_dai->remove) if (cpu_dai->remove)
cpu_dai->remove(pdev); cpu_dai->remove(pdev, cpu_dai);
} }
if (machine->remove) if (machine->remove)
...@@ -827,7 +827,7 @@ static int soc_remove(struct platform_device *pdev) ...@@ -827,7 +827,7 @@ static int soc_remove(struct platform_device *pdev)
for (i = 0; i < machine->num_links; i++) { for (i = 0; i < machine->num_links; i++) {
struct snd_soc_cpu_dai *cpu_dai = machine->dai_link[i].cpu_dai; struct snd_soc_cpu_dai *cpu_dai = machine->dai_link[i].cpu_dai;
if (cpu_dai->remove) if (cpu_dai->remove)
cpu_dai->remove(pdev); cpu_dai->remove(pdev, cpu_dai);
} }
if (machine->remove) if (machine->remove)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment