diff options
author | Mark Brown <broonie@kernel.org> | 2023-06-16 15:55:20 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2023-06-16 15:55:20 +0200 |
commit | 1a32b4b9a6229233de70cec28fb5a87fabac2c41 (patch) | |
tree | 773f8a5c40ac3176d2a0613c51fc4cd333b1bcc2 /sound/soc/soc-pcm.c | |
parent | ASoC: loongson: fix compile testing on 32-bit (diff) | |
parent | ASoC: tegra: Fix Master Volume Control (diff) | |
download | linux-1a32b4b9a6229233de70cec28fb5a87fabac2c41.tar.xz linux-1a32b4b9a6229233de70cec28fb5a87fabac2c41.zip |
ASoC: Merge fixes due to dependencies
So we can apply the tlv320aic3xxx DT conversion.
Diffstat (limited to 'sound/soc/soc-pcm.c')
-rw-r--r-- | sound/soc/soc-pcm.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 6fc90bc25317..8896227e4fb7 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -2431,6 +2431,9 @@ int dpcm_be_dai_prepare(struct snd_soc_pcm_runtime *fe, int stream) if (!snd_soc_dpcm_be_can_update(fe, be, stream)) continue; + if (!snd_soc_dpcm_can_be_prepared(fe, be, stream)) + continue; + if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_PARAMS) && (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP) && (be->dpcm[stream].state != SND_SOC_DPCM_STATE_SUSPEND) && @@ -3087,3 +3090,20 @@ int snd_soc_dpcm_can_be_params(struct snd_soc_pcm_runtime *fe, return snd_soc_dpcm_check_state(fe, be, stream, state, ARRAY_SIZE(state)); } EXPORT_SYMBOL_GPL(snd_soc_dpcm_can_be_params); + +/* + * We can only prepare a BE DAI if any of it's FE are not prepared, + * running or paused for the specified stream direction. + */ +int snd_soc_dpcm_can_be_prepared(struct snd_soc_pcm_runtime *fe, + struct snd_soc_pcm_runtime *be, int stream) +{ + const enum snd_soc_dpcm_state state[] = { + SND_SOC_DPCM_STATE_START, + SND_SOC_DPCM_STATE_PAUSED, + SND_SOC_DPCM_STATE_PREPARE, + }; + + return snd_soc_dpcm_check_state(fe, be, stream, state, ARRAY_SIZE(state)); +} +EXPORT_SYMBOL_GPL(snd_soc_dpcm_can_be_prepared); |