diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2023-06-01 00:42:49 +0000 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2023-06-06 16:57:31 +0100 |
commit | 1c943f60e830d0b959c765df09d4c4b254de0481 (patch) | |
tree | e1b38e3ffa76b4901d3149afd89ffb9b6c9484a3 /sound/soc/soc-dapm.c | |
parent | b9aa53fbee1e55abfcdfcc081c242de3c0582be4 (diff) | |
download | lwn-1c943f60e830d0b959c765df09d4c4b254de0481.tar.gz lwn-1c943f60e830d0b959c765df09d4c4b254de0481.zip |
ASoC: add snd_soc_get_stream_cpu()
We are using get_stream_cpu() to get CPU stream which cares
Codec2Codec. But it is static function for now, and we want to use it
from other files. This patch makes it global function.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87fs7cj9mf.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/soc-dapm.c')
-rw-r--r-- | sound/soc/soc-dapm.c | 35 |
1 files changed, 1 insertions, 34 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index c65cc374bb3f..b7b31d4e8ae8 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -4338,39 +4338,6 @@ static void dapm_connect_dai_routes(struct snd_soc_dapm_context *dapm, snd_soc_dapm_add_path(dapm, src, sink, NULL, NULL); } -static int get_stream_cpu(struct snd_soc_dai_link *dai_link, int stream) -{ - /* - * [Normal] - * - * Playback - * CPU : SNDRV_PCM_STREAM_PLAYBACK - * Codec: SNDRV_PCM_STREAM_PLAYBACK - * - * Playback - * CPU : SNDRV_PCM_STREAM_CAPTURE - * Codec: SNDRV_PCM_STREAM_CAPTURE - */ - if (!dai_link->c2c_params) - return stream; - - /* - * [Codec2Codec] - * - * Playback - * CPU : SNDRV_PCM_STREAM_CAPTURE - * Codec: SNDRV_PCM_STREAM_PLAYBACK - * - * Capture - * CPU : SNDRV_PCM_STREAM_PLAYBACK - * Codec: SNDRV_PCM_STREAM_CAPTURE - */ - if (stream == SNDRV_PCM_STREAM_CAPTURE) - return SNDRV_PCM_STREAM_PLAYBACK; - - return SNDRV_PCM_STREAM_CAPTURE; -} - static void dapm_connect_dai_pair(struct snd_soc_card *card, struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *codec_dai, @@ -4388,7 +4355,7 @@ static void dapm_connect_dai_pair(struct snd_soc_card *card, for_each_pcm_streams(stream) { int stream_cpu, stream_codec; - stream_cpu = get_stream_cpu(dai_link, stream); + stream_cpu = snd_soc_get_stream_cpu(dai_link, stream); stream_codec = stream; /* connect BE DAI playback if widgets are valid */ |