Commit 95c93d85 authored by Scott Jiang's avatar Scott Jiang Committed by Mark Brown

ASoC: ad193x: fix dac word len setting

dac word len value should left shift before setting
Signed-off-by: default avatarScott Jiang <scott.jiang.linux@gmail.com>
Acked-by: default avatarBarry Song <21cnbao@gmail.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
parent bf545ed7
...@@ -307,7 +307,8 @@ static int ad193x_hw_params(struct snd_pcm_substream *substream, ...@@ -307,7 +307,8 @@ static int ad193x_hw_params(struct snd_pcm_substream *substream,
snd_soc_write(codec, AD193X_PLL_CLK_CTRL0, reg); snd_soc_write(codec, AD193X_PLL_CLK_CTRL0, reg);
reg = snd_soc_read(codec, AD193X_DAC_CTRL2); 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); snd_soc_write(codec, AD193X_DAC_CTRL2, reg);
reg = snd_soc_read(codec, AD193X_ADC_CTRL1); reg = snd_soc_read(codec, AD193X_ADC_CTRL1);
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#define AD193X_DAC_LEFT_HIGH (1 << 3) #define AD193X_DAC_LEFT_HIGH (1 << 3)
#define AD193X_DAC_BCLK_INV (1 << 7) #define AD193X_DAC_BCLK_INV (1 << 7)
#define AD193X_DAC_CTRL2 0x804 #define AD193X_DAC_CTRL2 0x804
#define AD193X_DAC_WORD_LEN_SHFT 3
#define AD193X_DAC_WORD_LEN_MASK 0x18 #define AD193X_DAC_WORD_LEN_MASK 0x18
#define AD193X_DAC_MASTER_MUTE 1 #define AD193X_DAC_MASTER_MUTE 1
#define AD193X_DAC_CHNL_MUTE 0x805 #define AD193X_DAC_CHNL_MUTE 0x805
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment