[alsa-devel] [PATCH v2 2/5] ASoC: ad193x: fix dac word len setting
Barry Song
21cnbao at gmail.com
Mon Aug 15 04:42:26 CEST 2011
2011/8/13 Scott Jiang <scott.jiang.linux at gmail.com>:
> dac word len value should left shift before setting
>
> Signed-off-by: Scott Jiang <scott.jiang.linux at gmail.com>
Acked-by: Barry Song <21cnbao at gmail.com>
if you can move AD193X_DAC_WORD_LEN_MASK from your another patch to
this, it is better.
> ---
> 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
More information about the Alsa-devel
mailing list