linux/sound/soc
Olivier Moysan 0d6defc7e0
ASoC: stm32: sai: manage rebind issue
The commit e894efef9a ("ASoC: core: add support to card rebind")
allows to rebind the sound card after a rebind of one of its component.
With this commit, the sound card is actually rebound,
but may be no more functional. The following problems have been seen
with STM32 SAI driver.

1) DMA channel is not requested:

With the sound card rebind the simplified call sequence is:
stm32_sai_sub_probe
	snd_soc_register_component
		snd_soc_try_rebind_card
			snd_soc_instantiate_card
	devm_snd_dmaengine_pcm_register

The problem occurs because the pcm must be registered,
before snd_soc_instantiate_card() is called.

Modify SAI driver, to change the call sequence as follows:
stm32_sai_sub_probe
	devm_snd_dmaengine_pcm_register
	snd_soc_register_component
		snd_soc_try_rebind_card

2) DMA channel is not released:

dma_release_channel() is not called when
devm_dmaengine_pcm_release() is executed.
This occurs because SND_DMAENGINE_PCM_DRV_NAME component,
has already been released through devm_component_release().

devm_dmaengine_pcm_release() should be called before
devm_component_release() to avoid this problem.

Call snd_dmaengine_pcm_unregister() and snd_soc_unregister_component()
explicitly from SAI driver, to have the right sequence.

Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Message-Id: <20200304102406.8093-1-olivier.moysan@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-04 13:18:50 +00:00
..
adi
amd ASoC: amd: ACP needs to be powered off in BIOS. 2020-02-17 14:37:44 +00:00
atmel ASoC: atmel: fix atmel_ssc_set_audio link failure 2020-02-10 11:59:09 +00:00
au1x ASoC: soc-core: remove bus_control 2020-01-21 17:07:08 +00:00
bcm ASoC: bcm: cygnus-ssp: move .suspend/.resume to component 2020-01-21 17:02:56 +00:00
cirrus ASoC: soc-core: remove bus_control 2020-01-21 17:07:08 +00:00
codecs ASoC: rt1015: modify pre-divider for sysclk 2020-03-03 14:00:01 +00:00
dwc ASoC: dwc: dwc-i2s: move .suspend/.resume to component 2020-01-21 17:05:35 +00:00
fsl ASoC: fsl_sai: Fix exiting path on probing failure 2020-02-06 15:52:50 +00:00
generic ASoC: simple-card: Don't create separate link when platform is present 2019-12-10 13:10:40 +00:00
hisilicon
img
intel ASoC: Intel: Skylake: Fix available clock counter incrementation 2020-02-24 20:34:07 +00:00
jz4740 ASoC: jz4740: jz4740-i2s: move .suspend/.resume to component 2020-01-21 17:03:32 +00:00
kirkwood ASoC: kirkwood: Drop superfluous ioctl PCM ops 2019-12-11 15:57:19 +00:00
mediatek ASoC: mediatek: move .suspend/.resume to component 2020-01-21 17:03:54 +00:00
meson ASoC: meson: g12a: add tohdmitx reset 2020-02-21 12:58:10 +00:00
mxs ASoC: Remove dev_err() usage after platform_get_irq() 2019-08-02 12:12:31 +01:00
pxa ASoC: soc-core: remove bus_control 2020-01-21 17:07:08 +00:00
qcom ASoC: qdsp6: q6asm-dai: constify copied structure 2020-01-01 21:38:48 +00:00
rockchip ASoC: Fixes for v5.4 2019-11-07 13:52:17 +01:00
samsung ASoC: samsung: i2s: move .suspend/.resume to component 2020-01-21 17:05:54 +00:00
sh ASoC: soc-core: remove bus_control 2020-01-21 17:07:08 +00:00
sirf ASoC: sirf: use devm_platform_ioremap_resource() to simplify code 2019-07-31 12:05:39 +01:00
sof ASoC: SOF: Fix snd_sof_ipc_stream_posn() 2020-03-03 14:00:02 +00:00
spear ASoC: spear: use devm_platform_ioremap_resource() to simplify code 2019-07-31 12:06:18 +01:00
sprd ASoC: sprd: Drop superfluous ioctl PCM ops 2019-12-11 15:59:40 +00:00
sti ASoC: sti: sti_uniperif: move .suspend/.resume to component 2020-01-21 17:04:37 +00:00
stm ASoC: stm32: sai: manage rebind issue 2020-03-04 13:18:50 +00:00
sunxi ASoC: sun8i-codec: Fix setting DAI data format 2020-02-17 21:58:41 +00:00
tegra ASoC: tegra: Revert 24 and 32 bit support 2020-02-02 12:07:47 +00:00
ti ASoC: ti: omap-mcpdm: move .suspend/.resume to component 2020-01-21 17:04:57 +00:00
txx9 ASoC: soc-core: remove bus_control 2020-01-21 17:07:08 +00:00
uniphier ASoC: uniphier: move .suspend/.resume to component 2020-01-21 17:05:16 +00:00
ux500 ASoC: ux500: ux500_msp_dai: remove unused DAI .suspend/.resume 2020-01-21 17:06:13 +00:00
xilinx ASoC: xilinx: Use managed buffer allocation 2019-12-11 16:43:25 +00:00
xtensa ASoC: xtensa: Use managed buffer allocation 2019-12-11 16:43:26 +00:00
zte sound: Fix Kconfig indentation 2019-10-07 03:53:03 +02:00
Kconfig ASoC: remove w90x900/nuc900 platform drivers 2019-08-12 14:00:29 +01:00
Makefile ASoC: remove w90x900/nuc900 platform drivers 2019-08-12 14:00:29 +01:00
soc-ac97.c
soc-acpi.c
soc-component.c ASoC: soc-component: tidyup snd_soc_pcm_component_sync_stop() 2020-02-28 17:06:09 +00:00
soc-compress.c ASoC: soc-pcm/soc-compress: don't use snd_soc_dapm_stream_stop() 2020-02-24 20:34:06 +00:00
soc-core.c ASoC: soc-core: remove null_snd_soc_ops 2020-01-23 12:20:06 +00:00
soc-dai.c ASoC: soc-core: remove DAI suspend/resume 2020-01-21 17:06:41 +00:00
soc-dapm.c ASoC: dapm: Correct DAPM handling of active widgets during shutdown 2020-02-28 17:06:08 +00:00
soc-devres.c
soc-generic-dmaengine-pcm.c ASoC: generic-dmaengine-pcm: Use managed buffer allocation 2019-12-11 16:43:23 +00:00
soc-io.c
soc-jack.c ASoC: Jack: Fix NULL pointer dereference in snd_soc_jack_report 2019-11-12 17:12:56 +00:00
soc-ops.c ASoC: soc-ops: use snd_soc_card_get_kcontrol() at snd_soc_limit_volume() 2019-10-03 14:37:20 +01:00
soc-pcm.c ASoC: soc-pcm/soc-compress: don't use snd_soc_dapm_stream_stop() 2020-02-24 20:34:06 +00:00
soc-topology.c ASoC: topology: Fix memleak in soc_tplg_manifest_load() 2020-02-19 19:48:43 +00:00
soc-utils.c ASoC: utils: Drop superfluous ioctl PCM ops 2019-12-11 16:00:48 +00:00