From: Zidan Wang Date: Tue, 12 May 2015 06:58:21 +0000 (+0800) Subject: ASoC: wm8960: add 32 bit word length support X-Git-Tag: firefly_0821_release~176^2~1082^2~116^2~1^6 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7a8c78675f3c81760cde8ef31a9fcb0cb9ace231;p=firefly-linux-kernel-4.4.55.git ASoC: wm8960: add 32 bit word length support According to referance manual, right justify mode can't support 32 bit word length. Signed-off-by: Zidan Wang Acked-by: Charles Keepax Signed-off-by: Mark Brown --- diff --git a/sound/soc/codecs/wm8960.c b/sound/soc/codecs/wm8960.c index c02ed1f1959a..56bb88da9f8e 100644 --- a/sound/soc/codecs/wm8960.c +++ b/sound/soc/codecs/wm8960.c @@ -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,