ASoC: imx-spdif: Use snd-soc-dummy CODEC driver to link card
Subsystems (4)
PATCH 1/1 ASoC: imx-spdif: Use snd-soc-dummy CODEC driver to link card
This is a quick fix for the below two issues when building spdif as modules.
1) If modprobing modules in order: (Step 1) snd-soc-fsl-spdif -> (Step 2) snd-soc-imx-spdif -> (Step 3) snd-soc-spdif-tx/rx, we will fail to create imx-spdif card and dai link unless we rmmod snd-soc-imx-spdif and modprobe it again due to the execution platform_driver_unregister() in probe() when meeting -EPROBE_DEFER at Step 2.
2) After "imx-spdif sound-spdif.17: dit-hifi <-> 2004000.spdif mapping ok", 'rmmod snd-soc-imx-spdif' would cause kernel dump with warning:
WARNING: CPU: 0 PID: 1301 at /home/rmk/git/linux-rmk/fs/sysfs/dir.c:915 sysfs_hash_and_remove+0x84/0x90()
sysfs: can not remove 'dapm_widget', no directory
This should be caused by disordered resourse releasing of the whole link. And trying to unregister the card and then CODEC dev can't fix this issue.
Thus this patch just provides a simple fix to these two bugs by using the snd-soc-dummy in the core instead of seperate snd-soc-spdif-tx/rx so that there's no need to handle the registering and unregistering of CODEC or CODEC dai any more.
--- sound/soc/fsl/Kconfig | 1 - sound/soc/fsl/imx-spdif.c | 84 ++++++++++++----------------------------------- 2 files changed, 21 insertions(+), 64 deletions(-)
sound/soc/fsl/Kconfig +0 -1
@@ -201,7 +201,6 @@ config SND_SOC_IMX_SPDIF tristate "SoC Audio support for i.MX boards with S/PDIF" select SND_SOC_IMX_PCM_DMA select SND_SOC_FSL_SPDIF - select SND_SOC_SPDIF select REGMAP_MMIO help SoC Audio support for i.MX boards with S/PDIF
sound/soc/fsl/imx-spdif.c +21 -63
132 lines not on this page · raw message
Signature · 1 line
1.8.4
Mark Brown
maintainerQuoted 1 line · Nicolin Chen
This is a quick fix for the below two issues when building spdif as modules.
Good thinking - this is a smart way of dealing with the issue. It'll mean that we don't have the application specific constraints but those could be added back in the driver later or we could do an explicit S/PDIF CODEC in the same style as dummy. Applied, thanks.
Quoted 7 lines · Mark Brown
Quoted 1 line · Nicolin Chen
This is a quick fix for the below two issues when building spdif as modules.
Good thinking - this is a smart way of dealing with the issue. It'll mean that we don't have the application specific constraints but those could be added back in the driver later or we could do an explicit S/PDIF CODEC in the same style as dummy. Applied, thanks.
Yes, it can circumvent all the unnecessary problems we've been through here even though the CODEC name 'dummy' doesn't look so flawless. The application constraints, what I understand should be the supporting formats and rates, have been already ensured in the CPU DAI driver, so we might not need to worry for the CODEC one.
Thank you for the suggestion of dummy driver at the first place and.. Happy new year :)
Nicolin Chen