Commit a7e20444 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: soc-pcm: add dpcm_set_be_update_state()

soc-pcm has dpcm_set_fe_update_state() to update FE's runtime_update
(except dpcm_fe_dai_do_trigger() which needs to update it without it).
OTOH, it doesn't have BE's update function.

	O: dpcm_set_fe_update_state()
	X: dpcm_set_be_update_state()

This patch add BE's dpcm_set_fe_update_state()
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87zh2k7uz1.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 9c6d7f93
...@@ -225,6 +225,12 @@ static void dpcm_set_fe_update_state(struct snd_soc_pcm_runtime *fe, ...@@ -225,6 +225,12 @@ static void dpcm_set_fe_update_state(struct snd_soc_pcm_runtime *fe,
snd_pcm_stream_unlock_irq(substream); snd_pcm_stream_unlock_irq(substream);
} }
static void dpcm_set_be_update_state(struct snd_soc_pcm_runtime *be,
int stream, enum snd_soc_dpcm_update state)
{
be->dpcm[stream].runtime_update = state;
}
/** /**
* snd_soc_runtime_action() - Increment/Decrement active count for * snd_soc_runtime_action() - Increment/Decrement active count for
* PCM runtime components * PCM runtime components
...@@ -1357,7 +1363,7 @@ static int dpcm_prune_paths(struct snd_soc_pcm_runtime *fe, int stream, ...@@ -1357,7 +1363,7 @@ static int dpcm_prune_paths(struct snd_soc_pcm_runtime *fe, int stream,
stream ? "capture" : "playback", stream ? "capture" : "playback",
dpcm->be->dai_link->name, fe->dai_link->name); dpcm->be->dai_link->name, fe->dai_link->name);
dpcm->state = SND_SOC_DPCM_LINK_STATE_FREE; dpcm->state = SND_SOC_DPCM_LINK_STATE_FREE;
dpcm->be->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_BE; dpcm_set_be_update_state(dpcm->be, stream, SND_SOC_DPCM_UPDATE_BE);
prune++; prune++;
} }
...@@ -1412,7 +1418,7 @@ static int dpcm_add_paths(struct snd_soc_pcm_runtime *fe, int stream, ...@@ -1412,7 +1418,7 @@ static int dpcm_add_paths(struct snd_soc_pcm_runtime *fe, int stream,
continue; continue;
/* new */ /* new */
be->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_BE; dpcm_set_be_update_state(be, stream, SND_SOC_DPCM_UPDATE_BE);
new++; new++;
} }
...@@ -1440,8 +1446,7 @@ void dpcm_clear_pending_state(struct snd_soc_pcm_runtime *fe, int stream) ...@@ -1440,8 +1446,7 @@ void dpcm_clear_pending_state(struct snd_soc_pcm_runtime *fe, int stream)
spin_lock_irqsave(&fe->card->dpcm_lock, flags); spin_lock_irqsave(&fe->card->dpcm_lock, flags);
for_each_dpcm_be(fe, stream, dpcm) for_each_dpcm_be(fe, stream, dpcm)
dpcm->be->dpcm[stream].runtime_update = dpcm_set_be_update_state(dpcm->be, stream, SND_SOC_DPCM_UPDATE_NO);
SND_SOC_DPCM_UPDATE_NO;
spin_unlock_irqrestore(&fe->card->dpcm_lock, flags); spin_unlock_irqrestore(&fe->card->dpcm_lock, flags);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment