summaryrefslogtreecommitdiff
path: root/sound/soc/soc-pcm.c
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2020-05-15 09:46:51 +0900
committerMark Brown <broonie@kernel.org>2020-05-18 16:15:03 +0100
commitb3dea624b52e8b18cd49f804ce70fe50374aa5db (patch)
treeb53c66e28089e531dbff974133c9c162785c1799 /sound/soc/soc-pcm.c
parent5552f8d72893cea29a0074a3ea0a1a5766858fcd (diff)
ASoC: use snd_soc_xxx_active()
We have snd_soc_dai/dai_stream/component_active() macro This patch uses it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/8736826n44.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/soc-pcm.c')
-rw-r--r--sound/soc/soc-pcm.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 8d414f0ae2f9..b7899da4217e 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -750,7 +750,7 @@ static int soc_pcm_close(struct snd_pcm_substream *substream)
}
for_each_rtd_components(rtd, i, component)
- if (!component->active)
+ if (!snd_soc_component_active(component))
pinctrl_pm_select_sleep_state(component->dev);
return 0;
@@ -844,7 +844,7 @@ static int soc_pcm_open(struct snd_pcm_substream *substream)
/* Symmetry only applies if we've already got an active stream. */
for_each_rtd_dais(rtd, i, dai) {
- if (dai->active) {
+ if (snd_soc_dai_active(dai)) {
ret = soc_pcm_apply_symmetry(substream, dai);
if (ret != 0)
goto config_err;
@@ -882,7 +882,7 @@ component_err:
}
for_each_rtd_components(rtd, i, component)
- if (!component->active)
+ if (!snd_soc_component_active(component))
pinctrl_pm_select_sleep_state(component->dev);
return ret;
@@ -1136,9 +1136,9 @@ static int soc_pcm_hw_free(struct snd_pcm_substream *substream)
/* clear the corresponding DAIs parameters when going to be inactive */
for_each_rtd_dais(rtd, i, dai) {
- int active = dai->stream_active[substream->stream];
+ int active = snd_soc_dai_stream_active(dai, substream->stream);
- if (dai->active == 1) {
+ if (snd_soc_dai_active(dai) == 1) {
dai->rate = 0;
dai->channels = 0;
dai->sample_bits = 0;
@@ -1907,7 +1907,7 @@ static int dpcm_apply_symmetry(struct snd_pcm_substream *fe_substream,
for_each_rtd_cpu_dais (fe, i, fe_cpu_dai) {
/* Symmetry only applies if we've got an active stream. */
- if (fe_cpu_dai->active) {
+ if (snd_soc_dai_active(fe_cpu_dai)) {
err = soc_pcm_apply_symmetry(fe_substream, fe_cpu_dai);
if (err < 0)
return err;
@@ -1936,7 +1936,7 @@ static int dpcm_apply_symmetry(struct snd_pcm_substream *fe_substream,
/* Symmetry only applies if we've got an active stream. */
for_each_rtd_dais(rtd, i, dai) {
- if (dai->active) {
+ if (snd_soc_dai_active(dai)) {
err = soc_pcm_apply_symmetry(fe_substream, dai);
if (err < 0)
return err;
@@ -2709,7 +2709,7 @@ static int soc_dpcm_fe_runtime_update(struct snd_soc_pcm_runtime *fe, int new)
return 0;
/* only check active links */
- if (!asoc_rtd_to_cpu(fe, 0)->active)
+ if (!snd_soc_dai_active(asoc_rtd_to_cpu(fe, 0)))
return 0;
/* DAPM sync will call this to update DSP paths */
@@ -2724,8 +2724,8 @@ static int soc_dpcm_fe_runtime_update(struct snd_soc_pcm_runtime *fe, int new)
continue;
/* skip if FE isn't currently playing/capturing */
- if (!asoc_rtd_to_cpu(fe, 0)->stream_active[stream] ||
- !asoc_rtd_to_codec(fe, 0)->stream_active[stream])
+ if (!snd_soc_dai_stream_active(asoc_rtd_to_cpu(fe, 0), stream) ||
+ !snd_soc_dai_stream_active(asoc_rtd_to_codec(fe, 0), stream))
continue;
paths = dpcm_path_get(fe, stream, &list);