v5.8: struct snd_soc_dai->active replaced by snd_soc_dai_active(snd_soc_dai)

commit 0812a08ac8d054efc6cf2895d3b0e82c8731f8e9
Author: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date:   Fri May 15 09:48:02 2020 +0900

    ASoC: cleanup dai / component active code

    No one is using dai->active, snd_soc_component_is_active().
    Let's remove these.

commit efffd9b344adbf813e3ae6f6136df80000bf2833
Author: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date:   Fri May 15 09:46:37 2020 +0900

    ASoC: soc-dai: add snd_soc_dai_active()

    Current snd_soc_dai_action() is updating
    dai->stream_active for Playback/Capture (A),
    dai->active        for DAI (B)

            void snd_soc_dai_action(struct snd_soc_dai *dai,
                                    int stream, int action)
            {
    (A)             dai->stream_active[stream]      += action;
    (B)             dai->active                     += action;
                    dai->component->active          += action;
            }

    But, these are very verbose, because we can calculate
    DAI active from stream_active.

    This patch adds snd_soc_dai_active() which calculate
    DAI active from DAI stream_active.
This commit is contained in:
Hin-Tak Leung 2020-08-30 18:59:11 +01:00
parent 1452d85e0f
commit c3adcde556

View file

@ -956,9 +956,9 @@ void ac101_aif_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai
AC101_DBG("stream = %s, play: %d, capt: %d, active: %d\n", AC101_DBG("stream = %s, play: %d, capt: %d, active: %d\n",
snd_pcm_stream_str(substream), snd_pcm_stream_str(substream),
codec_dai->stream_active[SNDRV_PCM_STREAM_PLAYBACK], codec_dai->stream_active[SNDRV_PCM_STREAM_CAPTURE], codec_dai->stream_active[SNDRV_PCM_STREAM_PLAYBACK], codec_dai->stream_active[SNDRV_PCM_STREAM_CAPTURE],
codec_dai->active); snd_soc_dai_active(codec_dai));
if (!codec_dai->active) { if (snd_soc_dai_active(codec_dai)) {
ac10x->aif1_clken = 1; ac10x->aif1_clken = 1;
ac101_aif1clk(codec, SND_SOC_DAPM_POST_PMD, 0); ac101_aif1clk(codec, SND_SOC_DAPM_POST_PMD, 0);
} else { } else {