ASoC: soc-pcm: share DPCM BE DAI stop operation
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tue, 9 Mar 2021 01:08:17 +0000 (10:08 +0900)
committerMark Brown <broonie@kernel.org>
Fri, 12 Mar 2021 14:26:32 +0000 (14:26 +0000)
commit531590bb40f827fb3c4398148af0797f95bbaee2
treecf7fa0d3f76e38d9e6c1905a4f5867c2957e7a63
parent20048a9a4070d046a868c3be3b4f7bdc139cc203
ASoC: soc-pcm: share DPCM BE DAI stop operation

soc-pcm has very similar but different DPCM BE DAI stop operation at
1) dpcm_be_dai_startup() error case rollback
2) dpcm_be_dai_startup_unwind()
3) dpcm_be_dai_shutdown()

The differences are
1) for rollback
2) Doesn't check by snd_soc_dpcm_be_can_update() (Is this bug ?)
3) Do soc_pcm_hw_free() if it was not !OPENed and !HW_FREEed,
   and call soc_pcm_close().

We can share same code by
1) hw_free is not needed. Needs last dpcm as rollback.
2) hw_free is not needed.
3) hw_free is     needed.

This patch adds new dpcm_be_dai_stop() and share these 3.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87a6rduoam.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
include/sound/soc-dpcm.h
sound/soc/soc-compress.c
sound/soc/soc-pcm.c