]> Git Repo - linux.git/commitdiff
ASoC: soc-link: add snd_soc_link_compr_shutdown()
authorKuninori Morimoto <[email protected]>
Mon, 25 May 2020 00:57:45 +0000 (09:57 +0900)
committerMark Brown <[email protected]>
Mon, 25 May 2020 13:22:13 +0000 (14:22 +0100)
dai_link related function should be implemented at soc-link.c.
This patch adds snd_soc_link_compr_shutdown().

Signed-off-by: Kuninori Morimoto <[email protected]>
Reviewed-by: Ranjani Sridharan <[email protected]>
Reviewed-by: Pierre-Louis Bossart <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
include/sound/soc-link.h
sound/soc/soc-compress.c
sound/soc/soc-link.c

index 20fe46f31e33ef0a3ad83da205224611d942317e..9ada62f8186fa3b219ba1793a981382abe66e17c 100644 (file)
@@ -21,5 +21,6 @@ void snd_soc_link_hw_free(struct snd_pcm_substream *substream);
 int snd_soc_link_trigger(struct snd_pcm_substream *substream, int cmd);
 
 int snd_soc_link_compr_startup(struct snd_compr_stream *cstream);
+void snd_soc_link_compr_shutdown(struct snd_compr_stream *cstream);
 
 #endif /* __SOC_LINK_H */
index ddc6c6f69d2f30827ca97e66151de81b520220ca..327bec05295440adc7a80ec22041d21eaadc462b 100644 (file)
@@ -227,8 +227,7 @@ static int soc_compr_free(struct snd_compr_stream *cstream)
        if (!snd_soc_dai_active(codec_dai))
                codec_dai->rate = 0;
 
-       if (rtd->dai_link->compr_ops && rtd->dai_link->compr_ops->shutdown)
-               rtd->dai_link->compr_ops->shutdown(cstream);
+       snd_soc_link_compr_shutdown(cstream);
 
        soc_compr_components_free(cstream, NULL);
 
@@ -283,8 +282,7 @@ static int soc_compr_free_fe(struct snd_compr_stream *cstream)
 
        fe->dpcm[stream].runtime = NULL;
 
-       if (fe->dai_link->compr_ops && fe->dai_link->compr_ops->shutdown)
-               fe->dai_link->compr_ops->shutdown(cstream);
+       snd_soc_link_compr_shutdown(cstream);
 
        soc_compr_components_free(cstream, NULL);
 
index 7f0fb53c435a747363734b4c4e75f4dc118222d2..2cfe7f88b80952c79e850901b11ebcbcd734bb50 100644 (file)
@@ -126,3 +126,13 @@ int snd_soc_link_compr_startup(struct snd_compr_stream *cstream)
        return soc_link_ret(rtd, ret);
 }
 EXPORT_SYMBOL_GPL(snd_soc_link_compr_startup);
+
+void snd_soc_link_compr_shutdown(struct snd_compr_stream *cstream)
+{
+       struct snd_soc_pcm_runtime *rtd = cstream->private_data;
+
+       if (rtd->dai_link->compr_ops &&
+           rtd->dai_link->compr_ops->shutdown)
+               rtd->dai_link->compr_ops->shutdown(cstream);
+}
+EXPORT_SYMBOL_GPL(snd_soc_link_compr_shutdown);
This page took 0.05164 seconds and 4 git commands to generate.