All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
To: Mark Brown <broonie@kernel.org>
Cc: "Shengjiu Wang" <shengjiu.wang@nxp.com>,
	Linux-ALSA <alsa-devel@alsa-project.org>,
	"Michael Walle" <michael@walle.cc>,
	"\"Heiko Stübner\"" <heiko@sntech.de>,
	"Neil Armstrong" <narmstrong@baylibre.com>,
	"David Airlie" <airlied@linux.ie>,
	"\"Michał Mirosław\"" <mirq-linux@rere.qmqm.pl>,
	"Jonghwan Choi" <charlie.jh@kakaocorp.com>,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
	"Paul Cercueil" <paul@crapouillou.net>,
	"Andrzej Hajda" <a.hajda@samsung.com>,
	"Frank Shi" <shifu0704@thundersoft.com>,
	"Laurent Pinchart" <Laurent.pinchart@ideasonboard.com>,
	"Benjamin Gaignard" <benjamin.gaignard@linaro.org>,
	"Andrew F. Davis" <afd@ti.com>,
	"Fabio Estevam" <festevam@gmail.com>,
	"Jerome Brunet" <jbrunet@baylibre.com>,
	"Nikita Yushchenko" <nikita.yoush@cogentembedded.com>,
	"Pierre-Louis Bossart" <pierre-louis.bossart@linux.intel.com>,
	"Lars-Peter Clausen" <lars@metafoo.de>,
	"Joonyoung Shim" <jy0922.shim@samsung.com>,
	"Matthias Reichl" <hias@horus.com>,
	"Katsuhiro Suzuki" <katsuhiro@katsuster.net>,
	"Kevin Hilman" <khilman@baylibre.com>,
	"Kai Vehmanen" <kai.vehmanen@linux.intel.com>,
	"Takashi Iwai" <tiwai@suse.com>,
	YueHaibing <yuehaibing@huawei.com>,
	"Russell King" <linux@armlinux.org.uk>,
	"Krzysztof Kozlowski" <krzk@kernel.org>,
	"Daniel Drake" <drake@endlessm.com>,
	"Tzung-Bi Shih" <tzungbi@google.com>,
	"Ludovic Desroches" <ludovic.desroches@microchip.com>,
	"Kukjin Kim" <kgene@kernel.org>,
	"Ranjani Sridharan" <ranjani.sridharan@linux.intel.com>,
	"Dinghao Liu" <dinghao.liu@zju.edu.cn>,
	"Codrin Ciubotariu" <codrin.ciubotariu@microchip.com>,
	"Cheng-Yi Chiang" <cychiang@chromium.org>,
	"Chun-Kuang Hu" <chunkuang.hu@kernel.org>,
	"Bartosz Golaszewski" <bgolaszewski@baylibre.com>,
	"Charles Keepax" <ckeepax@opensource.cirrus.com>,
	"Philipp Zabel" <p.zabel@pengutronix.de>,
	"Jonas Karlman" <jonas@kwiboo.se>,
	"Liam Girdwood" <lgirdwood@gmail.com>,
	"Nicolas Ferre" <nicolas.ferre@microchip.com>,
	"Chuhong Yuan" <hslester96@gmail.com>,
	"Robin Murphy" <robin.murphy@arm.com>,
	"James Schulman" <james.schulman@cirrus.com>,
	"Inki Dae" <inki.dae@samsung.com>,
	"Masahiro Yamada" <masahiroy@kernel.org>,
	"Christophe JAILLET" <christophe.jaillet@wanadoo.fr>,
	"Dan Murphy" <dmurphy@ti.com>,
	"Matthias Brugger" <matthias.bgg@gmail.com>,
	"\"Nuno Sá\"" <nuno.sa@analog.com>,
	"Vincent Abriou" <vincent.abriou@st.com>,
	"Peter Ujfalusi" <peter.ujfalusi@ti.com>,
	"Jernej Skrabec" <jernej.skrabec@siol.net>,
	"Support Opensource" <support.opensource@diasemi.com>,
	"Marek Szyprowski" <m.szyprowski@samsung.com>,
	"Jason Yan" <yanaijie@huawei.com>,
	"Stephen Boyd" <sboyd@kernel.org>,
	"Pankaj Bharadiya" <pankaj.laxminarayan.bharadiya@intel.com>,
	"David Rhodes" <david.rhodes@cirrus.com>,
	"Seung-Woo Kim" <sw0312.kim@samsung.com>,
	"Sandy Huang" <hjc@rock-chips.com>, "Pavel Dobias" <dobias@2n.cz>,
	"Philipp Puschmann" <p.puschmann@pironex.de>,
	"Kyungmin Park" <kyungmin.park@samsung.com>,
	"Vishwas A Deshpande" <vishwas.a.deshpande@ti.com>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"Colin Ian King" <colin.king@canonical.com>,
	"Kevin Cernekee" <cernekee@chromium.org>,
	"Lucas Stach" <l.stach@pengutronix.de>,
	"Shawn Guo" <shawnguo@kernel.org>,
	"Peter Rosin" <peda@axentia.se>,
	"M R Swami Reddy" <mr.swami.reddy@ti.com>
Subject: [PATCH 14/19] ASoC: codecs: es*: merge .digital_mute() into .mute_stream()
Date: 23 Jun 2020 10:20:48 +0900	[thread overview]
Message-ID: <87v9ji1ssu.wl-kuninori.morimoto.gx@renesas.com> (raw)
In-Reply-To: <87ftam37ko.wl-kuninori.morimoto.gx@renesas.com>

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

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 <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/codecs/es8316.c | 7 +++++--
 sound/soc/codecs/es8328.c | 7 +++++--
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/sound/soc/codecs/es8316.c b/sound/soc/codecs/es8316.c
index 36eef1fb3d18..6e0066fc9e26 100644
--- a/sound/soc/codecs/es8316.c
+++ b/sound/soc/codecs/es8316.c
@@ -507,8 +507,11 @@ static int es8316_pcm_hw_params(struct snd_pcm_substream *substream,
 	return 0;
 }
 
-static int es8316_mute(struct snd_soc_dai *dai, int mute)
+static int es8316_mute(struct snd_soc_dai *dai, int mute, int direction)
 {
+	if (direction != SNDRV_PCM_STREAM_PLAYBACK)
+		return 0;
+
 	snd_soc_component_update_bits(dai->component, ES8316_DAC_SET1, 0x20,
 			    mute ? 0x20 : 0);
 	return 0;
@@ -522,7 +525,7 @@ static const struct snd_soc_dai_ops es8316_ops = {
 	.hw_params = es8316_pcm_hw_params,
 	.set_fmt = es8316_set_dai_fmt,
 	.set_sysclk = es8316_set_dai_sysclk,
-	.digital_mute = es8316_mute,
+	.mute_stream = es8316_mute,
 };
 
 static struct snd_soc_dai_driver es8316_dai = {
diff --git a/sound/soc/codecs/es8328.c b/sound/soc/codecs/es8328.c
index fdf64c29f563..b8ac7b31e2b9 100644
--- a/sound/soc/codecs/es8328.c
+++ b/sound/soc/codecs/es8328.c
@@ -449,8 +449,11 @@ static const struct snd_soc_dapm_route es8328_dapm_routes[] = {
 	{ "ROUT2", NULL, "Right Out 2" },
 };
 
-static int es8328_mute(struct snd_soc_dai *dai, int mute)
+static int es8328_mute(struct snd_soc_dai *dai, int mute, int direction)
 {
+	if (direction != SNDRV_PCM_STREAM_PLAYBACK)
+		return 0;
+
 	return snd_soc_component_update_bits(dai->component, ES8328_DACCONTROL3,
 			ES8328_DACCONTROL3_DACMUTE,
 			mute ? ES8328_DACCONTROL3_DACMUTE : 0);
@@ -692,7 +695,7 @@ static int es8328_set_bias_level(struct snd_soc_component *component,
 static const struct snd_soc_dai_ops es8328_dai_ops = {
 	.startup	= es8328_startup,
 	.hw_params	= es8328_hw_params,
-	.digital_mute	= es8328_mute,
+	.mute_stream	= es8328_mute,
 	.set_sysclk	= es8328_set_sysclk,
 	.set_fmt	= es8328_set_dai_fmt,
 };
-- 
2.25.1


  parent reply	other threads:[~2020-06-24  8:02 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-23  1:16 [PATCH 00/19] ASoC: merge .digital_mute() into .mute_stream() Kuninori Morimoto
2020-06-23  1:19 ` [PATCH 01/19] ASoC: hdmi-codec: " Kuninori Morimoto
2020-06-23 15:18   ` Pierre-Louis Bossart
2020-06-23  1:19 ` [PATCH 02/19] ASoC: ti: " Kuninori Morimoto
2020-06-23  1:19 ` [PATCH 03/19] ASoC: spear: " Kuninori Morimoto
2020-06-23  1:19 ` [PATCH 04/19] ASoC: meson: " Kuninori Morimoto
2020-06-23  1:19 ` [PATCH 05/19] ASoC: atmel: " Kuninori Morimoto
2020-06-23 11:29   ` Alexandre Belloni
2020-06-23  1:20 ` [PATCH 06/19] ASoC: codecs: " Kuninori Morimoto
2020-06-23  1:20 ` [PATCH 07/19] ASoC: codecs: tlv*: " Kuninori Morimoto
2020-06-23  1:20 ` [PATCH 08/19] ASoC: codecs: tas*: " Kuninori Morimoto
2020-06-23  1:20 ` [PATCH 09/19] ASoC: codecs: ssm*: " Kuninori Morimoto
2020-06-23  1:20 ` [PATCH 10/19] ASoC: codecs: pcm*: " Kuninori Morimoto
2020-06-23  1:20 ` [PATCH 11/19] ASoC: codecs: max*: " Kuninori Morimoto
2020-06-23  1:20 ` [PATCH 12/19] ASoC: codecs: alc*: " Kuninori Morimoto
2020-06-23  1:20 ` [PATCH 13/19] ASoC: codecs: wm*: " Kuninori Morimoto
2020-06-23 10:29   ` Charles Keepax
2020-06-23  1:20 ` Kuninori Morimoto [this message]
2020-06-23  1:20 ` [PATCH 15/19] ASoC: codecs: da*: " Kuninori Morimoto
2020-06-23 15:16   ` Adam Thomson
2020-06-23  1:20 ` [PATCH 16/19] ASoC: codecs: cs*: " Kuninori Morimoto
2020-06-23  1:21 ` [PATCH 17/19] ASoC: codecs: ak*: " Kuninori Morimoto
2020-06-23  1:21 ` [PATCH 18/19] ASoC: soc-dai: remove .digital_mute Kuninori Morimoto
2020-06-23 15:31   ` Dan Murphy
2020-06-23  1:21 ` [PATCH 19/19] ASoC: soc-core: snd_soc_dai_digital_mute() for both CPU/Codec Kuninori Morimoto
2020-06-23  9:34 ` [PATCH 00/19] ASoC: merge .digital_mute() into .mute_stream() Peter Ujfalusi

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=87v9ji1ssu.wl-kuninori.morimoto.gx@renesas.com \
    --to=kuninori.morimoto.gx@renesas.com \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=a.hajda@samsung.com \
    --cc=afd@ti.com \
    --cc=airlied@linux.ie \
    --cc=alexandre.belloni@bootlin.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=benjamin.gaignard@linaro.org \
    --cc=bgolaszewski@baylibre.com \
    --cc=broonie@kernel.org \
    --cc=cernekee@chromium.org \
    --cc=charlie.jh@kakaocorp.com \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=chunkuang.hu@kernel.org \
    --cc=ckeepax@opensource.cirrus.com \
    --cc=codrin.ciubotariu@microchip.com \
    --cc=colin.king@canonical.com \
    --cc=cychiang@chromium.org \
    --cc=daniel@ffwll.ch \
    --cc=david.rhodes@cirrus.com \
    --cc=dinghao.liu@zju.edu.cn \
    --cc=dmurphy@ti.com \
    --cc=dobias@2n.cz \
    --cc=drake@endlessm.com \
    --cc=festevam@gmail.com \
    --cc=heiko@sntech.de \
    --cc=hias@horus.com \
    --cc=hjc@rock-chips.com \
    --cc=hslester96@gmail.com \
    --cc=inki.dae@samsung.com \
    --cc=james.schulman@cirrus.com \
    --cc=jbrunet@baylibre.com \
    --cc=jernej.skrabec@siol.net \
    --cc=jonas@kwiboo.se \
    --cc=jy0922.shim@samsung.com \
    --cc=kai.vehmanen@linux.intel.com \
    --cc=katsuhiro@katsuster.net \
    --cc=kgene@kernel.org \
    --cc=khilman@baylibre.com \
    --cc=krzk@kernel.org \
    --cc=kyungmin.park@samsung.com \
    --cc=l.stach@pengutronix.de \
    --cc=lars@metafoo.de \
    --cc=lgirdwood@gmail.com \
    --cc=linux@armlinux.org.uk \
    --cc=ludovic.desroches@microchip.com \
    --cc=m.szyprowski@samsung.com \
    --cc=masahiroy@kernel.org \
    --cc=matthias.bgg@gmail.com \
    --cc=michael@walle.cc \
    --cc=mirq-linux@rere.qmqm.pl \
    --cc=mr.swami.reddy@ti.com \
    --cc=narmstrong@baylibre.com \
    --cc=nicolas.ferre@microchip.com \
    --cc=nikita.yoush@cogentembedded.com \
    --cc=nuno.sa@analog.com \
    --cc=p.puschmann@pironex.de \
    --cc=p.zabel@pengutronix.de \
    --cc=pankaj.laxminarayan.bharadiya@intel.com \
    --cc=paul@crapouillou.net \
    --cc=peda@axentia.se \
    --cc=peter.ujfalusi@ti.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=ranjani.sridharan@linux.intel.com \
    --cc=robin.murphy@arm.com \
    --cc=sboyd@kernel.org \
    --cc=shawnguo@kernel.org \
    --cc=shengjiu.wang@nxp.com \
    --cc=shifu0704@thundersoft.com \
    --cc=support.opensource@diasemi.com \
    --cc=sw0312.kim@samsung.com \
    --cc=tiwai@suse.com \
    --cc=tzungbi@google.com \
    --cc=vincent.abriou@st.com \
    --cc=vishwas.a.deshpande@ti.com \
    --cc=yanaijie@huawei.com \
    --cc=yuehaibing@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.