Commit b7ddd9ca authored by Andrew F. Davis's avatar Andrew F. Davis Committed by Mark Brown

ASoC: tlv320aic32x4: Use snd_soc_update_bits() in aic32x4_mute()

Simplify mute function by using snd_soc_update_bits() over
read/modify/write style code.
Signed-off-by: default avatarAndrew F. Davis <afd@ti.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 0fe7aa39
...@@ -773,13 +773,10 @@ static int aic32x4_hw_params(struct snd_pcm_substream *substream, ...@@ -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) static int aic32x4_mute(struct snd_soc_dai *dai, int mute)
{ {
struct snd_soc_codec *codec = dai->codec; struct snd_soc_codec *codec = dai->codec;
u8 dac_reg;
dac_reg = snd_soc_read(codec, AIC32X4_DACMUTE) & ~AIC32X4_MUTEON; snd_soc_update_bits(codec, AIC32X4_DACMUTE,
if (mute) AIC32X4_MUTEON, mute ? AIC32X4_MUTEON : 0);
snd_soc_write(codec, AIC32X4_DACMUTE, dac_reg | AIC32X4_MUTEON);
else
snd_soc_write(codec, AIC32X4_DACMUTE, dac_reg);
return 0; return 0;
} }
......
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