From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolin Chen Subject: Re: [PATCH] ASoC: soc-pcm: Use valid condition for snd_soc_dai_digital_mute() in hw_free() Date: Mon, 2 Dec 2013 18:39:48 +0800 Message-ID: <20131202103948.GA8609@MrMyself> References: <1385976874-30755-1-git-send-email-b42378@freescale.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from ch1outboundpool.messaging.microsoft.com (ch1ehsobe003.messaging.microsoft.com [216.32.181.183]) by alsa0.perex.cz (Postfix) with ESMTP id 8EB9826260F for ; Mon, 2 Dec 2013 11:46:53 +0100 (CET) Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Takashi Iwai Cc: alsa-devel@alsa-project.org, broonie@kernel.org, lgirdwood@gmail.com List-Id: alsa-devel@alsa-project.org On Mon, Dec 02, 2013 at 11:05:31AM +0100, Takashi Iwai wrote: > At Mon, 2 Dec 2013 17:34:34 +0800, > Nicolin Chen wrote: > > > > The snd_soc_dai_digital_mute() here will be never executed because we only > > decrease codec->active in snd_soc_close(). Thus correct it. > > A couple of minor problems by this approach: > > - snd_soc_dai_digital_mute() will be called twice in the normal PCM > close path. > > - In full duplex mode where both playback/capture streams share the > same codec, one of the directions won't be handled correctly because > codec->active is incremented/decremented twice (once for each > direction). > Thank you for the comments. I didn't look at the whole board. Please Drop this patch. Thank you. Nicolin Chen > > Takashi > > > > > Signed-off-by: Nicolin Chen > > --- > > sound/soc/soc-pcm.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c > > index 22af038..7d19117 100644 > > --- a/sound/soc/soc-pcm.c > > +++ b/sound/soc/soc-pcm.c > > @@ -689,7 +689,7 @@ static int soc_pcm_hw_free(struct snd_pcm_substream *substream) > > } > > > > /* apply codec digital mute */ > > - if (!codec->active) > > + if (codec->active == 1) > > snd_soc_dai_digital_mute(codec_dai, 1, substream->stream); > > > > /* free any machine hw params */ > > -- > > 1.8.4 > > > > >