Skip to contentSkip to conversation

ASoC: ak4535: Improve readability for setting mute

PATCH In review Axel Lin 2 participants 2 messages Dec 1, 2010

Subsystems (2)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 ASoC: ak4535: Improve readability for setting mute

The mute/unmute is controled by SMUTE (Soft Mute Control bit):
0: Normal Operation (Default)
1: DAC outputs soft-muted

I think this change improves readability.

---
 sound/soc/codecs/ak4535.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
sound/soc/codecs/ak4535.c +5 -5
index 7367545..8b38739 100644
@@ -366,9 +366,9 @@ static int ak4535_set_dai_fmt(struct snd_soc_dai *codec_dai,
 static int ak4535_mute(struct snd_soc_dai *dai, int mute)
 {
 	struct snd_soc_codec *codec = dai->codec;
-	u16 mute_reg = ak4535_read_reg_cache(codec, AK4535_DAC) & 0xffdf;
+	u16 mute_reg = ak4535_read_reg_cache(codec, AK4535_DAC);
 	if (!mute)
-		ak4535_write(codec, AK4535_DAC, mute_reg);
+		ak4535_write(codec, AK4535_DAC, mute_reg & ~0x20);
 	else
 		ak4535_write(codec, AK4535_DAC, mute_reg | 0x20);
 	return 0;
@@ -381,11 +381,11 @@ static int ak4535_set_bias_level(struct snd_soc_codec *codec,
 
 	switch (level) {
 	case SND_SOC_BIAS_ON:
-		mute_reg = ak4535_read_reg_cache(codec, AK4535_DAC) & 0xffdf;
-		ak4535_write(codec, AK4535_DAC, mute_reg);
+		mute_reg = ak4535_read_reg_cache(codec, AK4535_DAC);
+		ak4535_write(codec, AK4535_DAC, mute_reg & ~0x20);
 		break;
 	case SND_SOC_BIAS_PREPARE:
-		mute_reg = ak4535_read_reg_cache(codec, AK4535_DAC) & 0xffdf;
+		mute_reg = ak4535_read_reg_cache(codec, AK4535_DAC);
 		ak4535_write(codec, AK4535_DAC, mute_reg | 0x20);
 		break;
 	case SND_SOC_BIAS_STANDBY:
Signature · 1 line
1.7.2
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Axel Lin

The mute/unmute is controled by SMUTE (Soft Mute Control bit):
0: Normal Operation (Default)
1: DAC outputs soft-muted

I think this change improves readability.

---

Signature · 3 lines
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk