Skip to content

Commit

Permalink
ASoC: tas2552: Simplify the tas2552_mute function
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Peter Ujfalusi authored and Mark Brown committed Jun 4, 2015
1 parent 7de544f commit e3606aa
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions sound/soc/codecs/tas2552.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit e3606aa

Please sign in to comment.