]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit - include/sound/soc-dai.h
ASoC: soc-dai: add snd_soc_dai_active()
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Fri, 15 May 2020 00:46:37 +0000 (09:46 +0900)
committerMark Brown <broonie@kernel.org>
Mon, 18 May 2020 15:15:01 +0000 (16:15 +0100)
commitefffd9b344adbf813e3ae6f6136df80000bf2833
treede2f30fa14d21ce2c84f544b1666b941801e32ca
parent45eb8666e52d2d1733fda7353e48906d34a71e5d
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.

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/877dxe6n4i.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
include/sound/soc-dai.h
sound/soc/soc-dai.c