Commit cca67a36 authored by Axel Lin's avatar Axel Lin Committed by Mark Brown

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.
Signed-off-by: default avatarAxel Lin <axel.lin@gmail.com>
Acked-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 806bfedf
...@@ -366,9 +366,9 @@ static int ak4535_set_dai_fmt(struct snd_soc_dai *codec_dai, ...@@ -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) static int ak4535_mute(struct snd_soc_dai *dai, int mute)
{ {
struct snd_soc_codec *codec = dai->codec; 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) if (!mute)
ak4535_write(codec, AK4535_DAC, mute_reg); ak4535_write(codec, AK4535_DAC, mute_reg & ~0x20);
else else
ak4535_write(codec, AK4535_DAC, mute_reg | 0x20); ak4535_write(codec, AK4535_DAC, mute_reg | 0x20);
return 0; return 0;
...@@ -381,11 +381,11 @@ static int ak4535_set_bias_level(struct snd_soc_codec *codec, ...@@ -381,11 +381,11 @@ static int ak4535_set_bias_level(struct snd_soc_codec *codec,
switch (level) { switch (level) {
case SND_SOC_BIAS_ON: case SND_SOC_BIAS_ON:
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); ak4535_write(codec, AK4535_DAC, mute_reg & ~0x20);
break; break;
case SND_SOC_BIAS_PREPARE: 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); ak4535_write(codec, AK4535_DAC, mute_reg | 0x20);
break; break;
case SND_SOC_BIAS_STANDBY: case SND_SOC_BIAS_STANDBY:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment