alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] ASoC: ad193x: Fix define of AD193X_PLL_INPUT_MASK
@ 2011-10-14  9:01 Axel Lin
  2011-10-14  9:03 ` [PATCH 2/2] ASoC: ad193x: Use snd_soc_update_bits for read-modify-write Axel Lin
  2011-10-14 19:38 ` [PATCH 1/2] ASoC: ad193x: Fix define of AD193X_PLL_INPUT_MASK Mark Brown
  0 siblings, 2 replies; 11+ messages in thread
From: Axel Lin @ 2011-10-14  9:01 UTC (permalink / raw)
  To: linux-kernel; +Cc: Liam Girdwood, Mark Brown, Barry Song, alsa-devel

Current code defines AD193X_PLL_INPUT_MASK as (~0x6) which is quite
different from other MASK defines.
To make it consistent with other mask defines, define AD193X_PLL_INPUT_MASK
as 0x6 and change the code accordingly.
I think this change improves the readability.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 sound/soc/codecs/ad193x.c |    2 +-
 sound/soc/codecs/ad193x.h |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/ad193x.c b/sound/soc/codecs/ad193x.c
index f934670..39056ce 100644
--- a/sound/soc/codecs/ad193x.c
+++ b/sound/soc/codecs/ad193x.c
@@ -298,7 +298,7 @@ static int ad193x_hw_params(struct snd_pcm_substream *substream,
 	}
 
 	reg = snd_soc_read(codec, AD193X_PLL_CLK_CTRL0);
-	reg = (reg & AD193X_PLL_INPUT_MASK) | master_rate;
+	reg = (reg & (~AD193X_PLL_INPUT_MASK)) | master_rate;
 	snd_soc_write(codec, AD193X_PLL_CLK_CTRL0, reg);
 
 	reg = snd_soc_read(codec, AD193X_DAC_CTRL2);
diff --git a/sound/soc/codecs/ad193x.h b/sound/soc/codecs/ad193x.h
index 536e5f2..1507eaa 100644
--- a/sound/soc/codecs/ad193x.h
+++ b/sound/soc/codecs/ad193x.h
@@ -11,7 +11,7 @@
 
 #define AD193X_PLL_CLK_CTRL0    0x00
 #define AD193X_PLL_POWERDOWN           0x01
-#define AD193X_PLL_INPUT_MASK   (~0x6)
+#define AD193X_PLL_INPUT_MASK   0x6
 #define AD193X_PLL_INPUT_256    (0 << 1)
 #define AD193X_PLL_INPUT_384    (1 << 1)
 #define AD193X_PLL_INPUT_512    (2 << 1)
-- 
1.7.4.1

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

end of thread, other threads:[~2011-10-18  3:23 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-14  9:01 [PATCH 1/2] ASoC: ad193x: Fix define of AD193X_PLL_INPUT_MASK Axel Lin
2011-10-14  9:03 ` [PATCH 2/2] ASoC: ad193x: Use snd_soc_update_bits for read-modify-write Axel Lin
2011-10-14 19:10   ` Mark Brown
2011-10-15  3:21     ` Axel Lin
2011-10-17 21:37       ` Mark Brown
2011-10-18  3:23   ` Barry Song
2011-10-14 19:38 ` [PATCH 1/2] ASoC: ad193x: Fix define of AD193X_PLL_INPUT_MASK Mark Brown
2011-10-14 19:48   ` Lars-Peter Clausen
2011-10-14 20:07     ` Mark Brown
2011-10-14 20:09       ` Lars-Peter Clausen
2011-10-14 20:17         ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).