linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: ak4535: Improve readability for setting mute
@ 2010-12-01  9:22 Axel Lin
  2010-12-01  9:53 ` Liam Girdwood
  0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2010-12-01  9:22 UTC (permalink / raw)
  To: linux-kernel; +Cc: Richard Purdie, Liam Girdwood, Mark Brown, alsa-devel

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.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 sound/soc/codecs/ak4535.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/sound/soc/codecs/ak4535.c b/sound/soc/codecs/ak4535.c
index 7367545..8b38739 100644
--- a/sound/soc/codecs/ak4535.c
+++ b/sound/soc/codecs/ak4535.c
@@ -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:
-- 
1.7.2




^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ASoC: ak4535: Improve readability for setting mute
  2010-12-01  9:22 [PATCH] ASoC: ak4535: Improve readability for setting mute Axel Lin
@ 2010-12-01  9:53 ` Liam Girdwood
  0 siblings, 0 replies; 2+ messages in thread
From: Liam Girdwood @ 2010-12-01  9:53 UTC (permalink / raw)
  To: Axel Lin; +Cc: linux-kernel, Richard Purdie, Mark Brown, alsa-devel

On Wed, 2010-12-01 at 17:22 +0800, Axel Lin wrote:
> 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.
> 
> Signed-off-by: Axel Lin <axel.lin@gmail.com>
> ---

Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
-- 
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-12-01  9:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-01  9:22 [PATCH] ASoC: ak4535: Improve readability for setting mute Axel Lin
2010-12-01  9:53 ` Liam Girdwood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).