[alsa-devel] [PATCH 0/4] ASoC: atmel: fixes for working as module
The following patches fixes the audio part when working as module
Bo Shen (4): ASoC: atmel_pcm: make it buildable as module ASoC: atmel_ssc_dai: remove error set private data ASoC: atmel_ssc_dai: correct sequence when unload ASoC: sam9g20_wm8731: disable clock and correct sequence when unload
sound/soc/atmel/atmel-pcm.h | 6 ++++-- sound/soc/atmel/atmel_ssc_dai.c | 12 +----------- sound/soc/atmel/sam9g20_wm8731.c | 6 +++--- 3 files changed, 8 insertions(+), 16 deletions(-)
When build as module, it reports following error, using this patch fix it
sound/soc/atmel/atmel-pcm-pdc.c:387: error: redefinition of 'atmel_pcm_pdc_platform_register' sound/soc/atmel/atmel-pcm.h:95: note: previous definition of 'atmel_pcm_pdc_platform_register' was here sound/soc/atmel/atmel-pcm-pdc.c:393: error: redefinition of 'atmel_pcm_pdc_platform_unregister' sound/soc/atmel/atmel-pcm.h:99: note: previous definition of 'atmel_pcm_pdc_platform_unregister' was here
Signed-off-by: Bo Shen voice.shen@atmel.com --- sound/soc/atmel/atmel-pcm.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/sound/soc/atmel/atmel-pcm.h b/sound/soc/atmel/atmel-pcm.h index bb45d20..12ae814 100644 --- a/sound/soc/atmel/atmel-pcm.h +++ b/sound/soc/atmel/atmel-pcm.h @@ -88,7 +88,8 @@ void atmel_pcm_free(struct snd_pcm *pcm); int atmel_pcm_mmap(struct snd_pcm_substream *substream, struct vm_area_struct *vma);
-#ifdef CONFIG_SND_ATMEL_SOC_PDC +#if defined(CONFIG_SND_ATMEL_SOC_PDC) || \ + defined(CONFIG_SND_ATMEL_SOC_PDC_MODULE) int atmel_pcm_pdc_platform_register(struct device *dev); void atmel_pcm_pdc_platform_unregister(struct device *dev); #else @@ -101,7 +102,8 @@ static inline void atmel_pcm_pdc_platform_unregister(struct device *dev) } #endif
-#ifdef CONFIG_SND_ATMEL_SOC_DMA +#if defined(CONFIG_SND_ATMEL_SOC_DMA) || \ + defined(CONFIG_SND_ATMEL_SOC_DMA_MODULE) int atmel_pcm_dma_platform_register(struct device *dev); void atmel_pcm_dma_platform_unregister(struct device *dev); #else
ssc private data has been set in ssc driver, this cause the error private data set to ssc, remove it
Signed-off-by: Bo Shen voice.shen@atmel.com --- sound/soc/atmel/atmel_ssc_dai.c | 10 ---------- 1 file changed, 10 deletions(-)
diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c index 1c76634..2763aea 100644 --- a/sound/soc/atmel/atmel_ssc_dai.c +++ b/sound/soc/atmel/atmel_ssc_dai.c @@ -679,15 +679,6 @@ static int atmel_ssc_resume(struct snd_soc_dai *cpu_dai) # define atmel_ssc_resume NULL #endif /* CONFIG_PM */
-static int atmel_ssc_probe(struct snd_soc_dai *dai) -{ - struct atmel_ssc_info *ssc_p = &ssc_info[dai->id]; - - snd_soc_dai_set_drvdata(dai, ssc_p); - - return 0; -} - #define ATMEL_SSC_RATES (SNDRV_PCM_RATE_8000_96000)
#define ATMEL_SSC_FORMATS (SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_LE |\ @@ -703,7 +694,6 @@ static const struct snd_soc_dai_ops atmel_ssc_dai_ops = { };
static struct snd_soc_dai_driver atmel_ssc_dai = { - .probe = atmel_ssc_probe, .suspend = atmel_ssc_suspend, .resume = atmel_ssc_resume, .playback = {
correct the sequence when unload this module
Signed-off-by: Bo Shen voice.shen@atmel.com --- sound/soc/atmel/atmel_ssc_dai.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c index 2763aea..1fab8d5 100644 --- a/sound/soc/atmel/atmel_ssc_dai.c +++ b/sound/soc/atmel/atmel_ssc_dai.c @@ -780,8 +780,8 @@ void atmel_ssc_put_audio(int ssc_id) { struct ssc_device *ssc = ssc_info[ssc_id].ssc;
- ssc_free(ssc); asoc_ssc_exit(&ssc->pdev->dev); + ssc_free(ssc); } EXPORT_SYMBOL_GPL(atmel_ssc_put_audio);
disable clock and correct sequence when unload
Signed-off-by: Bo Shen voice.shen@atmel.com --- sound/soc/atmel/sam9g20_wm8731.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sound/soc/atmel/sam9g20_wm8731.c b/sound/soc/atmel/sam9g20_wm8731.c index da97629..2d6fbd0 100644 --- a/sound/soc/atmel/sam9g20_wm8731.c +++ b/sound/soc/atmel/sam9g20_wm8731.c @@ -305,10 +305,10 @@ static int at91sam9g20ek_audio_remove(struct platform_device *pdev) { struct snd_soc_card *card = platform_get_drvdata(pdev);
- atmel_ssc_put_audio(0); - snd_soc_unregister_card(card); - clk_put(mclk); + clk_disable(mclk); mclk = NULL; + snd_soc_unregister_card(card); + atmel_ssc_put_audio(0);
return 0; }
On Thu, Jan 31, 2013 at 11:53:36AM +0800, Bo Shen wrote:
The following patches fixes the audio part when working as module
Bo Shen (4): ASoC: atmel_pcm: make it buildable as module ASoC: atmel_ssc_dai: remove error set private data ASoC: atmel_ssc_dai: correct sequence when unload ASoC: sam9g20_wm8731: disable clock and correct sequence when unload
Applied all, thanks.
participants (2)
-
Bo Shen
-
Mark Brown