@@ -161,6 +161,10 @@ void snd_soc_dai_resume(struct snd_soc_dai *dai);
int snd_soc_dai_compress_new(struct snd_soc_dai *dai,
struct snd_soc_pcm_runtime *rtd, int num);
bool snd_soc_dai_stream_valid(struct snd_soc_dai *dai, int stream);
+void snd_soc_dai_action(struct snd_soc_dai *dai,
+ int stream, int action);
+#define snd_soc_dai_activate(dai, stream) snd_soc_dai_action(dai, stream, 1)
+#define snd_soc_dai_deactivate(dai, stream) snd_soc_dai_action(dai, stream, -1)
int snd_soc_pcm_dai_probe(struct snd_soc_pcm_runtime *rtd, int order);
int snd_soc_pcm_dai_remove(struct snd_soc_pcm_runtime *rtd, int order);
@@ -388,6 +388,15 @@ bool snd_soc_dai_stream_valid(struct snd_soc_dai *dai, int dir)
return stream->channels_min;
}
+void snd_soc_dai_action(struct snd_soc_dai *dai,
+ int stream, int action)
+{
+ dai->stream_active[stream] += action;
+ dai->active += action;
+ dai->component->active += action;
+}
+EXPORT_SYMBOL_GPL(snd_soc_dai_action);
+
int snd_soc_pcm_dai_probe(struct snd_soc_pcm_runtime *rtd, int order)
{
struct snd_soc_dai *dai;
@@ -276,11 +276,8 @@ void snd_soc_runtime_action(struct snd_soc_pcm_runtime *rtd,
lockdep_assert_held(&rtd->card->pcm_mutex);
- for_each_rtd_dais(rtd, i, dai) {
- dai->stream_active[stream] += action;
- dai->active += action;
- dai->component->active += action;
- }
+ for_each_rtd_dais(rtd, i, dai)
+ snd_soc_dai_action(dai, stream, action);
}
EXPORT_SYMBOL_GPL(snd_soc_runtime_action);