Skip to content

Commit

Permalink
ASoC: tlv320aic32x4: Use snd_soc_update_bits() in aic32x4_mute()
Browse files Browse the repository at this point in the history
Simplify mute function by using snd_soc_update_bits() over
read/modify/write style code.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Andrew F. Davis authored and Mark Brown committed Dec 13, 2017
1 parent 0fe7aa3 commit b7ddd9c
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions sound/soc/codecs/tlv320aic32x4.c
Original file line number Diff line number Diff line change
Expand Up @@ -773,13 +773,10 @@ static int aic32x4_hw_params(struct snd_pcm_substream *substream,
static int aic32x4_mute(struct snd_soc_dai *dai, int mute)
{
struct snd_soc_codec *codec = dai->codec;
u8 dac_reg;

dac_reg = snd_soc_read(codec, AIC32X4_DACMUTE) & ~AIC32X4_MUTEON;
if (mute)
snd_soc_write(codec, AIC32X4_DACMUTE, dac_reg | AIC32X4_MUTEON);
else
snd_soc_write(codec, AIC32X4_DACMUTE, dac_reg);
snd_soc_update_bits(codec, AIC32X4_DACMUTE,
AIC32X4_MUTEON, mute ? AIC32X4_MUTEON : 0);

return 0;
}

Expand Down

0 comments on commit b7ddd9c

Please sign in to comment.