[alsa-devel] [PATCH] ASoC: imx-spdif: Use module_init() to handle platform_device_register()

Nicolin Chen Guangyu.Chen at freescale.com
Tue Dec 17 11:31:05 CET 2013


On Mon, Dec 16, 2013 at 10:17:10PM +0000, Mark Brown wrote:
> I don't see registering the DAIs directly as adding complexity here;
> it's essentially what the current code is trying to do and doesn't
> change the normal device registration flow at all.  I do agree that the

Sir, I just tried to register the CODEC DAI in machine driver and it
works perfectly for module-loading. But when unloading it....
[...]
root at freescale ~$ modprobe snd-soc-imx-spdif
imx-spdif sound-spdif.10: S/PDIF-RX <-> 2004000.spdif mapping ok
root at freescale ~$ lsmod
Module                  Size  Used by
snd_soc_imx_spdif       3207  1
snd_soc_fsl_spdif       9604  2
imx_pcm_dma             1140  1 snd_soc_fsl_spdif
imx_sdma               10781  0 [permanent]
root at freescale ~$ rmmod snd-soc-imx-spdif
rmmod: can't unload 'snd_soc_imx_spdif': Resource temporarily unavailable
[...]
It looks like registering the CODEC DAI to the pdev->dev of machine driver
wasn't a good idea since it would lock itself up.

Then I also tried to register it to the pdev->dev of CPU DAI driver --
fsl-spdif, which is also the platform driver. The result is that there's
nothing wrong with module loading/unloading except one failure:
[...]
root at freescale ~$ rmmod snd-soc-imx-spdif
root at freescale ~$ modprobe snd-soc-imx-spdif
debugfs: creating file 'imx-spdif'
debugfs: creating file 'dapm_pop_time'
debugfs: creating file 'dapm'
debugfs: creating file 'bias_level'
debugfs: creating file '2004000.spdif'
debugfs: creating file 'cache_sync'
debugfs: creating file 'cache_only'
debugfs: creating file 'codec_reg'
debugfs: creating file 'dapm'
debugfs: creating file 'bias_level'
debugfs: creating file '2004000.spdif'
fsl-spdif-dai 2004000.spdif: ASoC: Failed to create platform debugfs directory
imx-spdif sound-spdif.10: S/PDIF-RX <-> 2004000.spdif mapping ok
debugfs: creating file 'Capture'
debugfs: creating file 'spdif-in'
[...]
It should be caused by the naming conflict since they are two exact same
names.

Although I'll continue finding another way to register it tomorrow, I think
it's better to make a simple report for this solution.

And if you have any idea, please guide me.

Thank you,
Nicolin Chen



More information about the Alsa-devel mailing list