All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: cs35l34: Simplify the logic to set CS35L34_MCLK_CTL setting
@ 2016-12-03  7:10 Axel Lin
  2016-12-05 17:03 ` Paul Handrigan
  2016-12-06 12:23 ` Applied "ASoC: cs35l34: Simplify the logic to set CS35L34_MCLK_CTL setting" to the asoc tree Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Axel Lin @ 2016-12-03  7:10 UTC (permalink / raw)
  To: Mark Brown
  Cc: Brian Austin, alsa-devel, Axel Lin, Liam Girdwood, Paul Handrigan

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 <axel.lin@ingics.com>
---
 sound/soc/codecs/cs35l34.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/soc/codecs/cs35l34.c b/sound/soc/codecs/cs35l34.c
index e0f672a..7c5d151 100644
--- a/sound/soc/codecs/cs35l34.c
+++ b/sound/soc/codecs/cs35l34.c
@@ -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:
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ASoC: cs35l34: Simplify the logic to set CS35L34_MCLK_CTL setting
  2016-12-03  7:10 [PATCH] ASoC: cs35l34: Simplify the logic to set CS35L34_MCLK_CTL setting Axel Lin
@ 2016-12-05 17:03 ` Paul Handrigan
  2016-12-06 12:23 ` Applied "ASoC: cs35l34: Simplify the logic to set CS35L34_MCLK_CTL setting" to the asoc tree Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Paul Handrigan @ 2016-12-05 17:03 UTC (permalink / raw)
  To: Axel Lin
  Cc: alsa-devel, Brian Austin, Mark Brown, Liam Girdwood, Paul Handrigan


On Sat, 3 Dec 2016, Axel Lin wrote:

> 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 <axel.lin@ingics.com>
> ---
>  sound/soc/codecs/cs35l34.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/sound/soc/codecs/cs35l34.c b/sound/soc/codecs/cs35l34.c
> index e0f672a..7c5d151 100644
> --- a/sound/soc/codecs/cs35l34.c
> +++ b/sound/soc/codecs/cs35l34.c
> @@ -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:

Acked-by: Paul Handrigan <Paul.Handrigan@cirrus.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Applied "ASoC: cs35l34: Simplify the logic to set CS35L34_MCLK_CTL setting" to the asoc tree
  2016-12-03  7:10 [PATCH] ASoC: cs35l34: Simplify the logic to set CS35L34_MCLK_CTL setting Axel Lin
  2016-12-05 17:03 ` Paul Handrigan
@ 2016-12-06 12:23 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2016-12-06 12:23 UTC (permalink / raw)
  To: Axel Lin
  Cc: Brian Austin, Mark Brown, alsa-devel, Paul Handrigan, Liam Girdwood

The patch

   ASoC: cs35l34: Simplify the logic to set CS35L34_MCLK_CTL setting

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 914657c2be09fb89a50c7841e98186301c93767e Mon Sep 17 00:00:00 2001
From: Axel Lin <axel.lin@ingics.com>
Date: Sat, 3 Dec 2016 15:10:50 +0800
Subject: [PATCH] ASoC: cs35l34: Simplify the logic to set CS35L34_MCLK_CTL
 setting

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 <axel.lin@ingics.com>
Acked-by: Paul Handrigan <Paul.Handrigan@cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/codecs/cs35l34.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/soc/codecs/cs35l34.c b/sound/soc/codecs/cs35l34.c
index e0f672af1d84..7c5d1510cf2c 100644
--- a/sound/soc/codecs/cs35l34.c
+++ b/sound/soc/codecs/cs35l34.c
@@ -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:
-- 
2.10.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-12-06 12:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-03  7:10 [PATCH] ASoC: cs35l34: Simplify the logic to set CS35L34_MCLK_CTL setting Axel Lin
2016-12-05 17:03 ` Paul Handrigan
2016-12-06 12:23 ` Applied "ASoC: cs35l34: Simplify the logic to set CS35L34_MCLK_CTL setting" to the asoc tree Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.