From: Scott Jiang <scott.jiang.linux@gmail.com>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: uclinux-dist-devel@blackfin.uclinux.org,
alsa-devel@alsa-project.org,
Scott Jiang <scott.jiang.linux@gmail.com>
Subject: [PATCH v2 2/5] ASoC: ad193x: fix dac word len setting
Date: Fri, 12 Aug 2011 18:04:11 -0400 [thread overview]
Message-ID: <1313186654-22520-2-git-send-email-scott.jiang.linux@gmail.com> (raw)
In-Reply-To: <1313186654-22520-1-git-send-email-scott.jiang.linux@gmail.com>
dac word len value should left shift before setting
Signed-off-by: Scott Jiang <scott.jiang.linux@gmail.com>
---
sound/soc/codecs/ad193x.c | 3 ++-
sound/soc/codecs/ad193x.h | 1 +
2 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/sound/soc/codecs/ad193x.c b/sound/soc/codecs/ad193x.c
index 2374ca5..f1a8be5 100644
--- a/sound/soc/codecs/ad193x.c
+++ b/sound/soc/codecs/ad193x.c
@@ -307,7 +307,8 @@ static int ad193x_hw_params(struct snd_pcm_substream *substream,
snd_soc_write(codec, AD193X_PLL_CLK_CTRL0, reg);
reg = snd_soc_read(codec, AD193X_DAC_CTRL2);
- reg = (reg & (~AD193X_DAC_WORD_LEN_MASK)) | word_len;
+ reg = (reg & (~AD193X_DAC_WORD_LEN_MASK))
+ | (word_len << AD193X_DAC_WORD_LEN_SHFT);
snd_soc_write(codec, AD193X_DAC_CTRL2, reg);
reg = snd_soc_read(codec, AD193X_ADC_CTRL1);
diff --git a/sound/soc/codecs/ad193x.h b/sound/soc/codecs/ad193x.h
index c1029d2..cccc2e8 100644
--- a/sound/soc/codecs/ad193x.h
+++ b/sound/soc/codecs/ad193x.h
@@ -34,6 +34,7 @@
#define AD193X_DAC_LEFT_HIGH (1 << 3)
#define AD193X_DAC_BCLK_INV (1 << 7)
#define AD193X_DAC_CTRL2 0x804
+#define AD193X_DAC_WORD_LEN_SHFT 3
#define AD193X_DAC_WORD_LEN_MASK 0x18
#define AD193X_DAC_MASTER_MUTE 1
#define AD193X_DAC_CHNL_MUTE 0x805
--
1.7.0.4
next prev parent reply other threads:[~2011-08-12 8:57 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-12 22:04 [PATCH v2 1/5] ASoC: ad193x: fix registers definition Scott Jiang
2011-08-12 21:05 ` Paul Menzel
2011-08-12 22:04 ` Scott Jiang [this message]
2011-08-15 2:42 ` [PATCH v2 2/5] ASoC: ad193x: fix dac word len setting Barry Song
2011-08-15 13:29 ` Mark Brown
2011-08-12 22:04 ` [PATCH v2 3/5] ASoC: ad193x: fix system clock Scott Jiang
2011-08-15 13:35 ` Mark Brown
2011-08-12 22:04 ` [PATCH v2 4/5] ASoC: add spi hw read function for 16 addr 8 data mode Scott Jiang
2011-08-15 2:46 ` Barry Song
2011-08-15 7:03 ` Scott Jiang
2011-08-15 13:37 ` Mark Brown
2011-08-12 22:04 ` [PATCH v2 5/5] ASoC: ad193x: remove cache support Scott Jiang
2011-08-15 13:43 ` Mark Brown
2011-08-15 13:29 ` [PATCH v2 1/5] ASoC: ad193x: fix registers definition 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=1313186654-22520-2-git-send-email-scott.jiang.linux@gmail.com \
--to=scott.jiang.linux@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=uclinux-dist-devel@blackfin.uclinux.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox