Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88952C433DF for ; Wed, 24 Jun 2020 07:52:58 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1485B20899 for ; Wed, 24 Jun 2020 07:52:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="HmD5YQkk" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1485B20899 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 371DF181D; Wed, 24 Jun 2020 09:52:06 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 371DF181D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1592985176; bh=okg8FBWz9PjlAHfVtRwN6lndH7DJ7dFdauuPPC4ylTE=; h=Date:From:To:Subject:References:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=HmD5YQkkXQif7SViprIm2i/kjJgMdDNJd4WRK46cA+M3Ax9AxEVmiM9VzSH6mzlUZ uLjguDfYsUWVVqR1J2Gy7Io7VzTDbfs8J3Y7Z6OmEvb6cILrq+HZU5nS3CJNHy/+sP J4KHE1oHED9Y1p8Pa13brKS8jyehNDvagdU3RfnI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 8ED00F802BE; Wed, 24 Jun 2020 09:49:38 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 786B8F80218; Tue, 23 Jun 2020 13:29:49 +0200 (CEST) Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 2BA76F8023E for ; Tue, 23 Jun 2020 13:29:42 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 2BA76F8023E X-Originating-IP: 86.202.110.81 Received: from localhost (lfbn-lyo-1-15-81.w86-202.abo.wanadoo.fr [86.202.110.81]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 69F8AFF808; Tue, 23 Jun 2020 11:29:32 +0000 (UTC) Date: Tue, 23 Jun 2020 13:29:31 +0200 From: Alexandre Belloni To: Kuninori Morimoto Subject: Re: [PATCH 05/19] ASoC: atmel: merge .digital_mute() into .mute_stream() Message-ID: <20200623112931.GM131826@piout.net> References: <87ftam37ko.wl-kuninori.morimoto.gx@renesas.com> <878sge37eq.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <878sge37eq.wl-kuninori.morimoto.gx@renesas.com> X-Mailman-Approved-At: Wed, 24 Jun 2020 09:49:28 +0200 Cc: Shengjiu Wang , Linux-ALSA , Michael Walle , =?iso-8859-1?B?IkhlaWtvIFN0/GJuZXIi?= , Neil Armstrong , David Airlie , =?utf-8?B?Ik1pY2hhxYIgTWlyb3PFgmF3Ig==?= , Jonghwan Choi , Paul Cercueil , Andrzej Hajda , Frank Shi , Laurent Pinchart , Benjamin Gaignard , "Andrew F. Davis" , Fabio Estevam , Jerome Brunet , Nikita Yushchenko , Pierre-Louis Bossart , Lars-Peter Clausen , Joonyoung Shim , Matthias Reichl , Katsuhiro Suzuki , Kevin Hilman , Kai Vehmanen , Takashi Iwai , YueHaibing , Russell King , Krzysztof Kozlowski , Daniel Drake , Tzung-Bi Shih , Ludovic Desroches , Kukjin Kim , Ranjani Sridharan , Dinghao Liu , Codrin Ciubotariu , Cheng-Yi Chiang , Chun-Kuang Hu , Bartosz Golaszewski , Charles Keepax , Philipp Zabel , Jonas Karlman , Liam Girdwood , Nicolas Ferre , Chuhong Yuan , Robin Murphy , James Schulman , Inki Dae , Masahiro Yamada , Mark Brown , Christophe JAILLET , Dan Murphy , Matthias Brugger , =?iso-8859-1?B?Ik51bm8gU+Ei?= , Vincent Abriou , Peter Ujfalusi , Jernej Skrabec , Support Opensource , Marek Szyprowski , Jason Yan , Stephen Boyd , Pankaj Bharadiya , David Rhodes , Seung-Woo Kim , Sandy Huang , Pavel Dobias , Philipp Puschmann , Kyungmin Park , Vishwas A Deshpande , Daniel Vetter , Colin Ian King , Kevin Cernekee , Lucas Stach , Shawn Guo , Peter Rosin , M R Swami Reddy X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On 23/06/2020 10:19:56+0900, Kuninori Morimoto wrote: > > From: Kuninori Morimoto > > snd_soc_dai_digital_mute() is internally using both > mute_stream() (1) or digital_mute() (2), but the difference between > these 2 are only handling direction. > We can merge digital_mute() into mute_stream > > int snd_soc_dai_digital_mute(xxx, int direction) > { > ... > else if (dai->driver->ops->mute_stream) > (1) return dai->driver->ops->mute_stream(xxx, direction); > else if (direction == SNDRV_PCM_STREAM_PLAYBACK && > dai->driver->ops->digital_mute) > (2) return dai->driver->ops->digital_mute(xxx); > ... > } > > Signed-off-by: Kuninori Morimoto Reviewed-by: Alexandre Belloni > --- > sound/soc/atmel/atmel-classd.c | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > > diff --git a/sound/soc/atmel/atmel-classd.c b/sound/soc/atmel/atmel-classd.c > index e98601eccfa3..59231c0371b8 100644 > --- a/sound/soc/atmel/atmel-classd.c > +++ b/sound/soc/atmel/atmel-classd.c > @@ -327,12 +327,16 @@ static int atmel_classd_codec_dai_startup(struct snd_pcm_substream *substream, > return clk_prepare_enable(dd->gclk); > } > > -static int atmel_classd_codec_dai_digital_mute(struct snd_soc_dai *codec_dai, > - int mute) > +static int atmel_classd_codec_dai_mute(struct snd_soc_dai *codec_dai, > + int mute, > + int direction) > { > struct snd_soc_component *component = codec_dai->component; > u32 mask, val; > > + if (direction != SNDRV_PCM_STREAM_PLAYBACK) > + return 0; > + > mask = CLASSD_MR_LMUTE_MASK | CLASSD_MR_RMUTE_MASK; > > if (mute) > @@ -469,7 +473,7 @@ static int atmel_classd_codec_dai_trigger(struct snd_pcm_substream *substream, > } > > static const struct snd_soc_dai_ops atmel_classd_codec_dai_ops = { > - .digital_mute = atmel_classd_codec_dai_digital_mute, > + .mute_stream = atmel_classd_codec_dai_mute, > .startup = atmel_classd_codec_dai_startup, > .shutdown = atmel_classd_codec_dai_shutdown, > .hw_params = atmel_classd_codec_dai_hw_params, > -- > 2.25.1 > -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com