All of lore.kernel.org
 help / color / mirror / Atom feed
From: Axel Lin <axel.lin@gmail.com>
To: alsa-devel@alsa-project.org
Cc: Vinod Koul <vinod.koul@linux.intel.com>,
	Liam Girdwood <lrg@ti.com>,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Brian Austin <brian.austin@cirrus.com>,
	Georgi Vlaev <joe@nucleusys.com>
Subject: [PATCH 1/2] ASoC: cs42l73: Unify the way to define bits of register
Date: Fri, 18 Nov 2011 16:05:13 +0800	[thread overview]
Message-ID: <1321603513.7338.3.camel@phoenix> (raw)

Current code defines some bits with left shift to the proper bit defined in
datasheet, but some don't.
Unify the definition with proper left shift and adjust the code accordingly.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
Hi, 
I don't have this hardware handy.
I'd appreciate if someone can test this serial of patches.

Thanks
Axel
 sound/soc/codecs/cs42l73.c |    6 +++---
 sound/soc/codecs/cs42l73.h |   18 +++++++++---------
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/sound/soc/codecs/cs42l73.c b/sound/soc/codecs/cs42l73.c
index 6fe259a..0306e72 100644
--- a/sound/soc/codecs/cs42l73.c
+++ b/sound/soc/codecs/cs42l73.c
@@ -1028,13 +1028,13 @@ static int cs42l73_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
 		switch (format) {
 		case SND_SOC_DAIFMT_DSP_B:
 			if (inv == SND_SOC_DAIFMT_IB_IF)
-				spc |= (PCM_MODE0 << 4);
+				spc |= PCM_MODE0;
 			if (inv == SND_SOC_DAIFMT_IB_NF)
-				spc |= (PCM_MODE1 << 4);
+				spc |= PCM_MODE1;
 		break;
 		case SND_SOC_DAIFMT_DSP_A:
 			if (inv == SND_SOC_DAIFMT_IB_IF)
-				spc |= (PCM_MODE1 << 4);
+				spc |= PCM_MODE1;
 			break;
 		default:
 			return -EINVAL;
diff --git a/sound/soc/codecs/cs42l73.h b/sound/soc/codecs/cs42l73.h
index 7c3bf7f..f30a4c4 100644
--- a/sound/soc/codecs/cs42l73.h
+++ b/sound/soc/codecs/cs42l73.h
@@ -162,16 +162,16 @@
 
 /* CS42L73_ASPC, CS42L73_XSPC, CS42L73_VSPC */
 #define	SP_3ST			(1 << 7)
-#define SPDIF_I2S		0
+#define SPDIF_I2S		(0 << 6)
 #define SPDIF_PCM		(1 << 6)
-#define PCM_MODE0		0
-#define PCM_MODE1		1
-#define PCM_MODE2		2
-#define PCM_BO_MSBLSB		0
-#define PCM_BO_LSBMSB		1
-#define MCK_SCLK_64FS		0
-#define MCK_SCLK_MCLK		2
-#define MCK_SCLK_PREMCLK	3
+#define PCM_MODE0		(0 << 4)
+#define PCM_MODE1		(1 << 4)
+#define PCM_MODE2		(2 << 4)
+#define PCM_MODE_MASK		(3 << 4)
+#define PCM_BIT_ORDER		(1 << 3)
+#define MCK_SCLK_64FS		(0 << 0)
+#define MCK_SCLK_MCLK		(2 << 0)
+#define MCK_SCLK_PREMCLK	(3 << 0)
 
 /* CS42L73_xSPMMCC */
 #define MS_MASTER		(1 << 7)
-- 
1.7.5.4

             reply	other threads:[~2011-11-18  8:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-18  8:05 Axel Lin [this message]
2011-11-18  8:06 ` [PATCH 2/2] ASoC: cs42l73: Fix clear wrong bits in cs42l73_set_dai_fmt Axel Lin
2011-11-18 14:50 ` [PATCH 1/2] ASoC: cs42l73: Unify the way to define bits of register Brian Austin
2011-11-18 18:57 ` Brian Austin
2011-11-22 13:02 ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1321603513.7338.3.camel@phoenix \
    --to=axel.lin@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=brian.austin@cirrus.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=joe@nucleusys.com \
    --cc=lrg@ti.com \
    --cc=vinod.koul@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.