ASoC: wm8960: add 32 bit word length support
authorZidan Wang <zidan.wang@freescale.com>
Tue, 12 May 2015 06:58:21 +0000 (14:58 +0800)
committerMark Brown <broonie@kernel.org>
Tue, 12 May 2015 19:05:30 +0000 (20:05 +0100)
According to referance manual, right justify mode can't
support 32 bit word length.

Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/wm8960.c

index c02ed1f..56bb88d 100644 (file)
@@ -655,6 +655,12 @@ static int wm8960_hw_params(struct snd_pcm_substream *substream,
        case 24:
                iface |= 0x0008;
                break;
+       case 32:
+               /* right justify mode does not support 32 word length */
+               if ((iface & 0x3) != 0) {
+                       iface |= 0x000c;
+                       break;
+               }
        default:
                dev_err(codec->dev, "unsupported width %d\n",
                        params_width(params));
@@ -1054,7 +1060,7 @@ static int wm8960_set_dai_sysclk(struct snd_soc_dai *dai, int clk_id,
 
 #define WM8960_FORMATS \
        (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \
-       SNDRV_PCM_FMTBIT_S24_LE)
+       SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE)
 
 static const struct snd_soc_dai_ops wm8960_dai_ops = {
        .hw_params = wm8960_hw_params,