summaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-pcm.c
diff options
context:
space:
mode:
authorChancel Liu <chancel.liu@nxp.com>2023-12-04 12:15:32 +0100
committerMark Brown <broonie@kernel.org>2023-12-18 15:04:24 +0100
commit8f039360897bdd2f1f455b46a7f504b677405913 (patch)
tree3471f38efe2a6e80c5d21a5be1258961f4913505 /sound/soc/soc-pcm.c
parentASoC: dt-bindings: qcom,sm8250: Add X1E80100 sound card (diff)
downloadlinux-8f039360897bdd2f1f455b46a7f504b677405913.tar.xz
linux-8f039360897bdd2f1f455b46a7f504b677405913.zip
ASoC: soc-pcm.c: Complete the active count for components without DAIs
Some components like platforms don't have DAIs. If the active count of these components is ignored pinctrl may be wrongly selected between default and sleep state. So need to increment or decrement the active count for components without DAIs to avoid it. Signed-off-by: Chancel Liu <chancel.liu@nxp.com> Link: https://msgid.link/r/20231204111532.3165-1-chancel.liu@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/soc-pcm.c')
-rw-r--r--sound/soc/soc-pcm.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index c20573aeb756..16a4644eff3a 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -292,6 +292,7 @@ static void dpcm_set_be_update_state(struct snd_soc_pcm_runtime *be,
void snd_soc_runtime_action(struct snd_soc_pcm_runtime *rtd,
int stream, int action)
{
+ struct snd_soc_component *component;
struct snd_soc_dai *dai;
int i;
@@ -299,6 +300,13 @@ void snd_soc_runtime_action(struct snd_soc_pcm_runtime *rtd,
for_each_rtd_dais(rtd, i, dai)
snd_soc_dai_action(dai, stream, action);
+
+ /* Increments/Decrements the active count for components without DAIs */
+ for_each_rtd_components(rtd, i, component) {
+ if (component->num_dai)
+ continue;
+ component->active += action;
+ }
}
EXPORT_SYMBOL_GPL(snd_soc_runtime_action);