[2/4] ASoC: wm8960: add 32 bit word length support
diff mbox

Message ID a55117060a6a22b1c523f19d9f47bd65054259e9.1431413323.git.zidan.wang@freescale.com
State Accepted
Commit 7a8c78675f3c81760cde8ef31a9fcb0cb9ace231
Headers show

Commit Message

Zidan Wang May 12, 2015, 6:58 a.m. UTC
According to referance manual, right justify mode can't
support 32 bit word length.

Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
---
 sound/soc/codecs/wm8960.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Comments

Charles Keepax May 12, 2015, 10:56 a.m. UTC | #1
On Tue, May 12, 2015 at 02:58:21PM +0800, Zidan Wang wrote:
> 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>

Thanks,
Charles

Patch
diff mbox

diff --git a/sound/soc/codecs/wm8960.c b/sound/soc/codecs/wm8960.c
index b072501..2559e31 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));
@@ -1050,7 +1056,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,