summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/tlv320aic32x4.c
diff options
context:
space:
mode:
authorAndrew F. Davis <afd@ti.com>2017-12-12 16:43:08 -0600
committerMark Brown <broonie@kernel.org>2017-12-13 12:28:30 +0000
commitb7ddd9cab7d1c800db83e442e881d8cb3f755633 (patch)
tree68ea25b59c29932adafeb020b310857137f37982 /sound/soc/codecs/tlv320aic32x4.c
parent0fe7aa39ba0492aabdde67dc1511055c9dc7e960 (diff)
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: Andrew F. Davis <afd@ti.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/tlv320aic32x4.c')
-rw-r--r--sound/soc/codecs/tlv320aic32x4.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/sound/soc/codecs/tlv320aic32x4.c b/sound/soc/codecs/tlv320aic32x4.c
index e528a8495346..5deabe36ae94 100644
--- a/sound/soc/codecs/tlv320aic32x4.c
+++ b/sound/soc/codecs/tlv320aic32x4.c
@@ -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;
}