From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
Mark Brown <broonie@kernel.org>
Cc: Linux-ALSA <alsa-devel@alsa-project.org>
Subject: Re: [PATCH 6/8] ASoC: soc-pcm: check DAI's activity more simply
Date: Wed, 26 Feb 2020 13:04:18 -0600 [thread overview]
Message-ID: <704a2cb1-ebcd-d433-0b8a-0f8d97d72fa5@linux.intel.com> (raw)
In-Reply-To: <875zft97i4.wl-kuninori.morimoto.gx@renesas.com>
On 2/26/20 12:40 AM, Kuninori Morimoto wrote:
>
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>
> DAI is counting its activity, and both playback/capture directional
> activity. When considering mute, DAI's activity is enough instead of
> caring both playback/capture.
> This patch makes mute check simply.
>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---
> sound/soc/soc-pcm.c | 7 +------
> 1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
> index 4a14f10b8c90..7e0464ec802e 100644
> --- a/sound/soc/soc-pcm.c
> +++ b/sound/soc/soc-pcm.c
> @@ -1202,7 +1202,6 @@ static int soc_pcm_hw_free(struct snd_pcm_substream *substream)
> struct snd_soc_pcm_runtime *rtd = substream->private_data;
> struct snd_soc_dai *cpu_dai;
> struct snd_soc_dai *codec_dai;
> - bool playback = substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
> int i;
>
> mutex_lock_nested(&rtd->card->pcm_mutex, rtd->card->pcm_subclass);
> @@ -1226,11 +1225,7 @@ static int soc_pcm_hw_free(struct snd_pcm_substream *substream)
>
> /* apply codec digital mute */
> for_each_rtd_codec_dai(rtd, i, codec_dai) {
> - int playback_active = codec_dai->stream_active[SNDRV_PCM_STREAM_PLAYBACK];
> - int capture_active = codec_dai->stream_active[SNDRV_PCM_STREAM_CAPTURE];
> -
> - if ((playback && playback_active == 1) ||
> - (!playback && capture_active == 1))
> + if (codec_dai->active == 1)
nit-pick: we have two tests in soc-pcm.c
if (codec_dai->active)
if (codec_dai->active == 1)
The two are functionality equivalent but it'd be good to choose one
version - or possibly use 'active' as a boolean.
> snd_soc_dai_digital_mute(codec_dai, 1,
> substream->stream);
> }
>
next prev parent reply other threads:[~2020-02-26 19:05 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-26 6:39 [PATCH 0/8] ASoC: soc-pcm cleanup step5 Kuninori Morimoto
2020-02-26 6:39 ` [PATCH 1/8] ASoC: soc-pcm: use defined stream Kuninori Morimoto
2020-02-26 6:40 ` [PATCH 2/8] ASoC: soc-pcm: remove duplicate be check from dpcm_add_paths() Kuninori Morimoto
2020-02-26 6:40 ` [PATCH 3/8] ASoC: soc-pcm: move dpcm_fe_dai_close() Kuninori Morimoto
2020-02-26 6:40 ` [PATCH 4/8] ASoC: soc-pcm: add dpcm_fe_dai_clean() Kuninori Morimoto
2020-02-26 17:49 ` Ranjani Sridharan
2020-02-27 0:13 ` Kuninori Morimoto
2020-02-26 6:40 ` [PATCH 5/8] ASoC: soc-pcm: use snd_soc_dai_get_pcm_stream() at dpcm_set_fe_runtime() Kuninori Morimoto
2020-02-26 6:40 ` [PATCH 6/8] ASoC: soc-pcm: check DAI's activity more simply Kuninori Morimoto
2020-02-26 19:04 ` Pierre-Louis Bossart [this message]
2020-02-27 0:35 ` Kuninori Morimoto
2020-02-27 0:40 ` Pierre-Louis Bossart
2020-02-27 0:43 ` Kuninori Morimoto
2020-02-27 1:23 ` Pierre-Louis Bossart
2020-02-27 2:00 ` Kuninori Morimoto
2020-02-27 2:34 ` Kuninori Morimoto
2020-02-26 6:40 ` [PATCH 7/8] ASoC: soc-pcm: Do Digital Mute for both CPU/Codec in same timing Kuninori Morimoto
2020-02-26 6:41 ` [PATCH 8/8] ASoC: soc-pcm: tidyup dulicate handing at dpcm_fe_dai_startup() Kuninori Morimoto
2020-02-26 15:22 ` Pierre-Louis Bossart
2020-02-27 0:04 ` Kuninori Morimoto
2020-02-26 15:24 ` [PATCH 0/8] ASoC: soc-pcm cleanup step5 Pierre-Louis Bossart
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=704a2cb1-ebcd-d433-0b8a-0f8d97d72fa5@linux.intel.com \
--to=pierre-louis.bossart@linux.intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=kuninori.morimoto.gx@renesas.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox