summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/tas2552.c
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@ti.com>2015-06-04 16:04:18 +0300
committerMark Brown <broonie@kernel.org>2015-06-04 17:50:02 +0100
commite3606aa496c98595cb206ac8fed9bc8152ffe34e (patch)
treeab4767f40c268dc5b0d99242b2bddf272c2bc438 /sound/soc/codecs/tas2552.c
parent7de544fd3275a136b311bfce9fe4406a1518d488 (diff)
downloadlwn-e3606aa496c98595cb206ac8fed9bc8152ffe34e.tar.gz
lwn-e3606aa496c98595cb206ac8fed9bc8152ffe34e.zip
ASoC: tas2552: Simplify the tas2552_mute function
Initialize the cfg1_reg to 0 and set the mute bit only when it is needed. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/tas2552.c')
-rw-r--r--sound/soc/codecs/tas2552.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sound/soc/codecs/tas2552.c b/sound/soc/codecs/tas2552.c
index 681b868a9e8c..2d52a397161d 100644
--- a/sound/soc/codecs/tas2552.c
+++ b/sound/soc/codecs/tas2552.c
@@ -254,13 +254,11 @@ static int tas2552_set_dai_sysclk(struct snd_soc_dai *dai, int clk_id,
static int tas2552_mute(struct snd_soc_dai *dai, int mute)
{
- u8 cfg1_reg;
+ u8 cfg1_reg = 0;
struct snd_soc_codec *codec = dai->codec;
if (mute)
- cfg1_reg = TAS2552_MUTE;
- else
- cfg1_reg = ~TAS2552_MUTE;
+ cfg1_reg |= TAS2552_MUTE;
snd_soc_update_bits(codec, TAS2552_CFG_1, TAS2552_MUTE, cfg1_reg);