summaryrefslogtreecommitdiffstats
path: root/sound/soc
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2020-07-09 10:56:05 +0900
committerMark Brown <broonie@kernel.org>2020-07-16 23:06:08 +0100
commit1ff123965bd00f1aacbd4549b03a6a5b98432eaf (patch)
tree075e02c53f58ae66d8e7c33035d4cf7a13719e05 /sound/soc
parent059374fe9ea5dd1e5a1d6b14741baf994dbc8dd2 (diff)
downloadlinux-1ff123965bd00f1aacbd4549b03a6a5b98432eaf.tar.gz
linux-1ff123965bd00f1aacbd4549b03a6a5b98432eaf.tar.bz2
linux-1ff123965bd00f1aacbd4549b03a6a5b98432eaf.zip
ASoC: spear: merge .digital_mute() into .mute_stream()
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> Reviewed-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Link: https://lore.kernel.org/r/87a709xxij.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/spear/spdif_out.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sound/soc/spear/spdif_out.c b/sound/soc/spear/spdif_out.c
index 58d5843811f9..38f9fff5be6b 100644
--- a/sound/soc/spear/spdif_out.c
+++ b/sound/soc/spear/spdif_out.c
@@ -188,7 +188,7 @@ static int spdif_out_trigger(struct snd_pcm_substream *substream, int cmd,
return ret;
}
-static int spdif_digital_mute(struct snd_soc_dai *dai, int mute)
+static int spdif_mute(struct snd_soc_dai *dai, int mute, int direction)
{
struct spdif_out_dev *host = snd_soc_dai_get_drvdata(dai);
u32 val;
@@ -229,7 +229,8 @@ static int spdif_mute_put(struct snd_kcontrol *kcontrol,
if (host->saved_params.mute == ucontrol->value.integer.value[0])
return 0;
- spdif_digital_mute(cpu_dai, ucontrol->value.integer.value[0]);
+ spdif_mute(cpu_dai, ucontrol->value.integer.value[0],
+ SNDRV_PCM_STREAM_PLAYBACK);
return 1;
}
@@ -250,11 +251,12 @@ static int spdif_soc_dai_probe(struct snd_soc_dai *dai)
}
static const struct snd_soc_dai_ops spdif_out_dai_ops = {
- .digital_mute = spdif_digital_mute,
+ .mute_stream = spdif_mute,
.startup = spdif_out_startup,
.shutdown = spdif_out_shutdown,
.trigger = spdif_out_trigger,
.hw_params = spdif_out_hw_params,
+ .no_capture_mute = 1,
};
static struct snd_soc_dai_driver spdif_out_dai = {