From patchwork Thu May 13 15:24:08 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Lapin X-Patchwork-Id: 99334 X-Patchwork-Delegate: tony@atomide.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4DFP2Zp031304 for ; Thu, 13 May 2010 15:25:02 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758981Ab0EMPZB (ORCPT ); Thu, 13 May 2010 11:25:01 -0400 Received: from build.ossfans.org ([67.223.233.67]:57309 "EHLO build.ossfans.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753641Ab0EMPZA (ORCPT ); Thu, 13 May 2010 11:25:00 -0400 Received: from build.ossfans.org ([127.0.0.1]) by build.ossfans.org (8.14.3/8.14.3/Debian-9.1) with ESMTP id o4DFOtBi014126; Thu, 13 May 2010 19:24:55 +0400 Received: (from slapin@localhost) by build.ossfans.org (8.14.3/8.14.3/Submit) id o4DFOpgZ014122; Thu, 13 May 2010 19:24:51 +0400 From: Sergey Lapin To: alsa-devel@alsa-project.org Cc: Tony Lindgren , linux-omap@vger.kernel.org, Sergey Lapin Subject: [PATCH] OMAP: McBSP: Add 32-bit mode support Date: Thu, 13 May 2010 19:24:08 +0400 Message-Id: <1273764248-14043-1-git-send-email-slapin@ossfans.org> X-Mailer: git-send-email 1.7.0 In-Reply-To: <1273757957-7299-1-git-send-email-slapin@ossfans.org> References: <1273757957-7299-1-git-send-email-slapin@ossfans.org> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 13 May 2010 15:25:02 +0000 (UTC) diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c index 8ad9dc9..a875d5d 100644 --- a/sound/soc/omap/omap-mcbsp.c +++ b/sound/soc/omap/omap-mcbsp.c @@ -295,8 +295,20 @@ static int omap_mcbsp_dai_hw_params(struct snd_pcm_substream *substream, omap_mcbsp_dai_dma_params[id][substream->stream].dma_req = dma; omap_mcbsp_dai_dma_params[id][substream->stream].port_addr = port; omap_mcbsp_dai_dma_params[id][substream->stream].sync_mode = sync_mode; - omap_mcbsp_dai_dma_params[id][substream->stream].data_type = - OMAP_DMA_DATA_TYPE_S16; + switch(params_format(params)) { + case SNDRV_PCM_FORMAT_S16_LE: + omap_mcbsp_dai_dma_params[id][substream->stream].data_type = + OMAP_DMA_DATA_TYPE_S16; + break; + case SNDRV_PCM_FORMAT_S32_LE: + omap_mcbsp_dai_dma_params[id][substream->stream].data_type = + OMAP_DMA_DATA_TYPE_S32; + break; + default: + omap_mcbsp_dai_dma_params[id][substream->stream].data_type = + OMAP_DMA_DATA_TYPE_S16; + break; + } snd_soc_dai_set_dma_data(cpu_dai, substream, &omap_mcbsp_dai_dma_params[id][substream->stream]); @@ -330,6 +342,14 @@ static int omap_mcbsp_dai_hw_params(struct snd_pcm_substream *substream, regs->xcr2 |= XWDLEN2(OMAP_MCBSP_WORD_16); regs->xcr1 |= XWDLEN1(OMAP_MCBSP_WORD_16); break; + case SNDRV_PCM_FORMAT_S32_LE: + /* Set word lengths */ + wlen = 32; + regs->rcr2 |= RWDLEN2(OMAP_MCBSP_WORD_32); + regs->rcr1 |= RWDLEN1(OMAP_MCBSP_WORD_32); + regs->xcr2 |= XWDLEN2(OMAP_MCBSP_WORD_32); + regs->xcr1 |= XWDLEN1(OMAP_MCBSP_WORD_32); + break; default: /* Unsupported PCM format */ return -EINVAL; @@ -623,13 +643,15 @@ static struct snd_soc_dai_ops omap_mcbsp_dai_ops = { .channels_min = 1, \ .channels_max = 16, \ .rates = OMAP_MCBSP_RATES, \ - .formats = SNDRV_PCM_FMTBIT_S16_LE, \ + .formats = SNDRV_PCM_FMTBIT_S16_LE | \ + SNDRV_PCM_FMTBIT_S32_LE, \ }, \ .capture = { \ .channels_min = 1, \ .channels_max = 16, \ .rates = OMAP_MCBSP_RATES, \ - .formats = SNDRV_PCM_FMTBIT_S16_LE, \ + .formats = SNDRV_PCM_FMTBIT_S16_LE | \ + SNDRV_PCM_FMTBIT_S32_LE, \ }, \ .ops = &omap_mcbsp_dai_ops, \ .private_data = &mcbsp_data[(link_id)].bus_id, \