Skip to content

Commit

Permalink
ASoC: cs35l34: Simplify the logic to set CS35L34_MCLK_CTL setting
Browse files Browse the repository at this point in the history
The logic of "value = ~CS35L34_MCLK_DIV & CS35L34_MCLK_RATE_XXXXXX;" is
unnecessary complex. By setting CS35L34_MCLK_DIV | CS35L34_MCLK_RATE_MASK
as the mask for regmap_update_bits() call, what the code does is exactly
the same as setting value = CS35L34_MCLK_RATE_XXXXXX.

Signed-off-by: Axel Lin <[email protected]>
Acked-by: Paul Handrigan <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
AxelLin authored and broonie committed Dec 6, 2016
1 parent 55060fe commit 914657c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sound/soc/codecs/cs35l34.c
Original file line number Diff line number Diff line change
Expand Up @@ -610,15 +610,15 @@ static int cs35l34_dai_set_sysclk(struct snd_soc_dai *dai,

switch (freq) {
case CS35L34_MCLK_5644:
value = ~CS35L34_MCLK_DIV & CS35L34_MCLK_RATE_5P6448;
value = CS35L34_MCLK_RATE_5P6448;
cs35l34->mclk_int = freq;
break;
case CS35L34_MCLK_6:
value = ~CS35L34_MCLK_DIV & CS35L34_MCLK_RATE_6P0000;
value = CS35L34_MCLK_RATE_6P0000;
cs35l34->mclk_int = freq;
break;
case CS35L34_MCLK_6144:
value = ~CS35L34_MCLK_DIV & CS35L34_MCLK_RATE_6P1440;
value = CS35L34_MCLK_RATE_6P1440;
cs35l34->mclk_int = freq;
break;
case CS35L34_MCLK_11289:
Expand Down

0 comments on commit 914657c

Please sign in to comment.