Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c24a34db authored by Daniel Mack's avatar Daniel Mack Committed by Mark Brown
Browse files

ASoC: cs4271: switch to mute_stream



Use the newly introduced mute_stream DAI operation, and don't mute the
codec if it's called for the _CAPTURE stream.

Signed-off-by: default avatarDaniel Mack <zonque@gmail.com>
Acked-by: default avatarAlexander Sverdlin <subaparts@yandex.ru>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 1b1861ea
Loading
Loading
Loading
Loading
+5 −2
Original line number Original line Diff line number Diff line
@@ -388,7 +388,7 @@ static int cs4271_hw_params(struct snd_pcm_substream *substream,
	return cs4271_set_deemph(codec);
	return cs4271_set_deemph(codec);
}
}


static int cs4271_digital_mute(struct snd_soc_dai *dai, int mute)
static int cs4271_mute_stream(struct snd_soc_dai *dai, int mute, int stream)
{
{
	struct snd_soc_codec *codec = dai->codec;
	struct snd_soc_codec *codec = dai->codec;
	struct cs4271_private *cs4271 = snd_soc_codec_get_drvdata(codec);
	struct cs4271_private *cs4271 = snd_soc_codec_get_drvdata(codec);
@@ -396,6 +396,9 @@ static int cs4271_digital_mute(struct snd_soc_dai *dai, int mute)
	int val_a = 0;
	int val_a = 0;
	int val_b = 0;
	int val_b = 0;


	if (stream != SNDRV_PCM_STREAM_PLAYBACK)
		return 0;

	if (mute) {
	if (mute) {
		val_a = CS4271_VOLA_MUTE;
		val_a = CS4271_VOLA_MUTE;
		val_b = CS4271_VOLB_MUTE;
		val_b = CS4271_VOLB_MUTE;
@@ -442,7 +445,7 @@ static const struct snd_soc_dai_ops cs4271_dai_ops = {
	.hw_params	= cs4271_hw_params,
	.hw_params	= cs4271_hw_params,
	.set_sysclk	= cs4271_set_dai_sysclk,
	.set_sysclk	= cs4271_set_dai_sysclk,
	.set_fmt	= cs4271_set_dai_fmt,
	.set_fmt	= cs4271_set_dai_fmt,
	.digital_mute	= cs4271_digital_mute,
	.mute_stream	= cs4271_mute_stream,
};
};


static struct snd_soc_dai_driver cs4271_dai = {
static struct snd_soc_dai_driver cs4271_dai = {