Re: [PATCH 18/19] ASoC: soc-dai: remove .digital_mute

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Kuninori

On 6/22/20 8:21 PM, Kuninori Morimoto wrote:
From: Kuninori Morimoto <kuninori.morimoto.gx@xxxxxxxxxxx>

All drivers are now using .mute_stream.
Let's remove .digital_mute.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@xxxxxxxxxxx>
---
  include/sound/soc-dai.h | 1 -
  sound/soc/soc-dai.c     | 4 ----
  2 files changed, 5 deletions(-)

diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h
index 212257e84fac..a3db208cd062 100644
--- a/include/sound/soc-dai.h
+++ b/include/sound/soc-dai.h
@@ -246,7 +246,6 @@ struct snd_soc_dai_ops {
  	 * DAI digital mute - optional.
  	 * Called by soc-core to minimise any pops.
  	 */
-	int (*digital_mute)(struct snd_soc_dai *dai, int mute);
  	int (*mute_stream)(struct snd_soc_dai *dai, int mute, int stream);
/*
diff --git a/sound/soc/soc-dai.c b/sound/soc/soc-dai.c
index b05e18b63a1c..b0fc3d8b1798 100644
--- a/sound/soc/soc-dai.c
+++ b/sound/soc/soc-dai.c
@@ -301,10 +301,6 @@ int snd_soc_dai_digital_mute(struct snd_soc_dai *dai, int mute,
  	if (dai->driver->ops &&
  	    dai->driver->ops->mute_stream)
  		ret = dai->driver->ops->mute_stream(dai, mute, direction);
-	else if (direction == SNDRV_PCM_STREAM_PLAYBACK &&
-		 dai->driver->ops &&
-		 dai->driver->ops->digital_mute)
-		ret = dai->driver->ops->digital_mute(dai, mute);

Instead of putting the direction check in every codec driver can't the check just part of the function? And then maybe a flag in dai_ops to override that call to mute?

if (direction != SNDRV_PCM_STREAM_PLAYBACK)
        return 0;

I did not look at every codec driver as there are too many.

Dan





[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux