diff options
| author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2026-08-31 06:38:29 +0000 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2026-09-09 16:42:33 +0100 |
| commit | b143c6c1348056049575554bf64ab4d27786785c (patch) | |
| tree | 5d3b9806c99fcf34c9a64ae1a9c0e1100aa06f71 | |
| parent | 6d2c9a5caa11f635a503b33a75dc0b75825f10fd (diff) | |
| download | linux-next-b143c6c1348056049575554bf64ab4d27786785c.tar.gz linux-next-b143c6c1348056049575554bf64ab4d27786785c.zip | |
ASoC: soc-dai: move soc_pcm_set_dai_params()
soc_pcm_set_dai_params() is DAI related function.
And its parameter will be capsuled soon, will be not enable to access from
soc-pcm.c. Move it to soc-dai.c
It renames function name
- soc_pcm_set_dai_params()
+ snd_soc_dai_symmetric_set_params()
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87se3usska.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
| -rw-r--r-- | include/sound/soc.h | 3 | ||||
| -rw-r--r-- | sound/soc/soc-compress.c | 5 | ||||
| -rw-r--r-- | sound/soc/soc-dai.c | 15 | ||||
| -rw-r--r-- | sound/soc/soc-internal.h | 6 | ||||
| -rw-r--r-- | sound/soc/soc-pcm.c | 25 |
5 files changed, 30 insertions, 24 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h index e49d1573ace5..25fecbe50d99 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -1392,9 +1392,6 @@ struct snd_soc_dai *snd_soc_find_dai( struct snd_soc_dai *snd_soc_find_dai_with_mutex( const struct snd_soc_dai_link_component *dlc); -void soc_pcm_set_dai_params(struct snd_soc_dai *dai, - struct snd_pcm_hw_params *params); - #include <sound/soc-dai.h> static inline diff --git a/sound/soc/soc-compress.c b/sound/soc/soc-compress.c index b8402802ae78..093a70a93d2b 100644 --- a/sound/soc/soc-compress.c +++ b/sound/soc/soc-compress.c @@ -20,6 +20,7 @@ #include <sound/initval.h> #include <sound/soc-dpcm.h> #include <sound/soc-link.h> +#include "soc-internal.h" static int snd_soc_compr_components_open(struct snd_compr_stream *cstream) { @@ -69,10 +70,10 @@ static int soc_compr_clean(struct snd_compr_stream *cstream, int rollback) snd_soc_dai_digital_mute(codec_dai, 1, stream); if (!snd_soc_dai_active(cpu_dai)) - soc_pcm_set_dai_params(cpu_dai, NULL); + snd_soc_dai_symmetric_set_params(cpu_dai, NULL); if (!snd_soc_dai_active(codec_dai)) - soc_pcm_set_dai_params(codec_dai, NULL); + snd_soc_dai_symmetric_set_params(codec_dai, NULL); snd_soc_link_compr_shutdown(cstream, rollback); diff --git a/sound/soc/soc-dai.c b/sound/soc/soc-dai.c index f9bb4fa356d7..b8b70c533070 100644 --- a/sound/soc/soc-dai.c +++ b/sound/soc/soc-dai.c @@ -6,6 +6,7 @@ // Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> // +#include <sound/pcm_params.h> #include <sound/soc.h> #include <sound/soc-dai.h> #include <sound/soc-link.h> @@ -1139,3 +1140,17 @@ struct snd_soc_dai *snd_soc_dai_register(struct snd_soc_component *component, return dai; } EXPORT_SYMBOL_GPL(snd_soc_dai_register); + +void snd_soc_dai_symmetric_set_params(struct snd_soc_dai *dai, + struct snd_pcm_hw_params *params) +{ + if (params) { + dai->symmetric_rate = params_rate(params); + dai->symmetric_channels = params_channels(params); + dai->symmetric_sample_bits = snd_pcm_format_physical_width(params_format(params)); + } else { + dai->symmetric_rate = 0; + dai->symmetric_channels = 0; + dai->symmetric_sample_bits = 0; + } +} diff --git a/sound/soc/soc-internal.h b/sound/soc/soc-internal.h index 1c43a06332c2..ce68402bde52 100644 --- a/sound/soc/soc-internal.h +++ b/sound/soc/soc-internal.h @@ -24,4 +24,10 @@ int snd_soc_add_controls(struct snd_card *card, struct device *dev, const struct snd_kcontrol_new *controls, int num_controls, const char *prefix, void *data); +/* + * In soc-dai + */ +void snd_soc_dai_symmetric_set_params(struct snd_soc_dai *dai, + struct snd_pcm_hw_params *params); + #endif /* __SOC_INTERNAL_H */ diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 0e49290a8c90..04d7079c338f 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -26,6 +26,7 @@ #include <sound/soc-dpcm.h> #include <sound/soc-link.h> #include <sound/initval.h> +#include "soc-internal.h" DEFINE_GUARD(snd_soc_card_mutex, struct snd_soc_card *, @@ -427,20 +428,6 @@ void dpcm_dapm_stream_event(struct snd_soc_pcm_runtime *fe, int dir, int event) snd_soc_dapm_stream_event(fe, dir, event); } -void soc_pcm_set_dai_params(struct snd_soc_dai *dai, - struct snd_pcm_hw_params *params) -{ - if (params) { - dai->symmetric_rate = params_rate(params); - dai->symmetric_channels = params_channels(params); - dai->symmetric_sample_bits = snd_pcm_format_physical_width(params_format(params)); - } else { - dai->symmetric_rate = 0; - dai->symmetric_channels = 0; - dai->symmetric_sample_bits = 0; - } -} - static int soc_pcm_apply_symmetry(struct snd_pcm_substream *substream, struct snd_soc_dai *soc_dai) { @@ -589,7 +576,7 @@ static int soc_pcm_params_symmetry(struct snd_pcm_substream *substream, unsigned int symmetry, i; d.name = __func__; - soc_pcm_set_dai_params(&d, params); + snd_soc_dai_symmetric_set_params(&d, params); #define __soc_pcm_params_symmetry(xxx) \ symmetry = rtd->dai_link->symmetric_##xxx; \ @@ -879,7 +866,7 @@ static int soc_pcm_clean(struct snd_soc_pcm_runtime *rtd, /* Make sure DAI parameters cleared if the DAI becomes inactive */ for_each_rtd_dais(rtd, i, dai) { if (snd_soc_dai_active(dai) == 0) - soc_pcm_set_dai_params(dai, NULL); + snd_soc_dai_symmetric_set_params(dai, NULL); } } @@ -1135,7 +1122,7 @@ static int soc_pcm_hw_clean(struct snd_soc_pcm_runtime *rtd, /* clear the corresponding DAIs parameters when going to be inactive */ for_each_rtd_dais(rtd, i, dai) { if (snd_soc_dai_active(dai) == 1) - soc_pcm_set_dai_params(dai, NULL); + snd_soc_dai_symmetric_set_params(dai, NULL); if (snd_soc_dai_stream_active(dai, substream->stream) == 1) { if (!snd_soc_dai_mute_is_ctrled_at_trigger(dai)) @@ -1237,7 +1224,7 @@ static int __soc_pcm_hw_params(struct snd_pcm_substream *substream, if(ret < 0) goto out; - soc_pcm_set_dai_params(codec_dai, &tmp_params); + snd_soc_dai_symmetric_set_params(codec_dai, &tmp_params); snd_soc_dapm_update_dai(substream, &tmp_params, codec_dai); } @@ -1275,7 +1262,7 @@ static int __soc_pcm_hw_params(struct snd_pcm_substream *substream, goto out; /* store the parameters for each DAI */ - soc_pcm_set_dai_params(cpu_dai, &tmp_params); + snd_soc_dai_symmetric_set_params(cpu_dai, &tmp_params); snd_soc_dapm_update_dai(substream, &tmp_params, cpu_dai); } |
