aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorScott Jiang <scott.jiang.linux@gmail.com>2011-08-12 18:04:11 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-08-15 09:29:22 -0400
commit95c93d8525ebce1024bda7316f602ae45c36cd6f (patch)
treee238a87b342fec03077e3e42722f229921b1b49e /sound
parentbf545ed72f2eeac664695a8ea2199d9ddaef6020 (diff)
ASoC: ad193x: fix dac word len setting
dac word len value should left shift before setting Signed-off-by: Scott Jiang <scott.jiang.linux@gmail.com> Acked-by: Barry Song <21cnbao@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@kernel.org
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/ad193x.c3
-rw-r--r--sound/soc/codecs/ad193x.h1
2 files changed, 3 insertions, 1 deletions
diff --git a/sound/soc/codecs/ad193x.c b/sound/soc/codecs/ad193x.c
index 2374ca5ffe68..f1a8be58255b 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,
307 snd_soc_write(codec, AD193X_PLL_CLK_CTRL0, reg); 307 snd_soc_write(codec, AD193X_PLL_CLK_CTRL0, reg);
308 308
309 reg = snd_soc_read(codec, AD193X_DAC_CTRL2); 309 reg = snd_soc_read(codec, AD193X_DAC_CTRL2);
310 reg = (reg & (~AD193X_DAC_WORD_LEN_MASK)) | word_len; 310 reg = (reg & (~AD193X_DAC_WORD_LEN_MASK))
311 | (word_len << AD193X_DAC_WORD_LEN_SHFT);
311 snd_soc_write(codec, AD193X_DAC_CTRL2, reg); 312 snd_soc_write(codec, AD193X_DAC_CTRL2, reg);
312 313
313 reg = snd_soc_read(codec, AD193X_ADC_CTRL1); 314 reg = snd_soc_read(codec, AD193X_ADC_CTRL1);
diff --git a/sound/soc/codecs/ad193x.h b/sound/soc/codecs/ad193x.h
index c1029d242c84..cccc2e8e5fbd 100644
--- a/sound/soc/codecs/ad193x.h
+++ b/sound/soc/codecs/ad193x.h
@@ -34,6 +34,7 @@
34#define AD193X_DAC_LEFT_HIGH (1 << 3) 34#define AD193X_DAC_LEFT_HIGH (1 << 3)
35#define AD193X_DAC_BCLK_INV (1 << 7) 35#define AD193X_DAC_BCLK_INV (1 << 7)
36#define AD193X_DAC_CTRL2 0x804 36#define AD193X_DAC_CTRL2 0x804
37#define AD193X_DAC_WORD_LEN_SHFT 3
37#define AD193X_DAC_WORD_LEN_MASK 0x18 38#define AD193X_DAC_WORD_LEN_MASK 0x18
38#define AD193X_DAC_MASTER_MUTE 1 39#define AD193X_DAC_MASTER_MUTE 1
39#define AD193X_DAC_CHNL_MUTE 0x805 40#define AD193X_DAC_CHNL_MUTE 0x805