From patchwork Tue May 24 18:50:16 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Gardiner X-Patchwork-Id: 813242 Received: from comal.ext.ti.com (comal.ext.ti.com [198.47.26.152]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p4OIqeuM004421 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 24 May 2011 18:53:01 GMT Received: from dlep33.itg.ti.com ([157.170.170.112]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id p4OIpcD7014598 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 24 May 2011 13:51:38 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by dlep33.itg.ti.com (8.13.7/8.13.7) with ESMTP id p4OIpckr013648; Tue, 24 May 2011 13:51:38 -0500 (CDT) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id A419380666; Tue, 24 May 2011 13:51:12 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp53.itg.ti.com (dflp53.itg.ti.com [128.247.5.6]) by linux.omap.com (Postfix) with ESMTP id 2E31B8064D for ; Tue, 24 May 2011 13:50:30 -0500 (CDT) Received: from red.ext.ti.com (red.ext.ti.com [192.94.93.37]) by dflp53.itg.ti.com (8.13.8/8.13.8) with ESMTP id p4OIoSnS020742 for ; Tue, 24 May 2011 13:50:28 -0500 (CDT) Received: from psmtp.com (na3sys009amx214.postini.com [74.125.149.54]) by red.ext.ti.com (8.13.7/8.13.7) with SMTP id p4OIoRXT022405 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 24 May 2011 13:50:27 -0500 Received: from na3sys009aog116.obsmtp.com ([209.85.220.173]) (using TLSv1) by na3sys009amx214.postini.com ([74.125.148.10]) with SMTP; Tue, 24 May 2011 11:50:28 PDT Received: from mail-vx0-f173.google.com ([209.85.220.173]) (using TLSv1) by na3sys009aob116.postini.com ([74.125.148.12]) with SMTP ID DSNKTdv98QMefuih6GaeluWJZtnL1iAgp3Je@postini.com; Tue, 24 May 2011 11:50:27 PDT Received: by mail-vx0-f173.google.com with SMTP id 37so5940581vxb.4 for ; Tue, 24 May 2011 11:50:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nanometrics.ca; s=google; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=NpKydrqZWDLoDbxnN7EMTIQpHj4OL371DHSEqFmZjQ4=; b=UrzbcMPeU8qXNrXd0ZyprsOnnpSwYZrefipKYbrsjE+dGelB0hpjoLR2mXm6ZJuxMW 5ZHJqj4ZzeigvGuRXpwfWwoEYejqP7c9DghzrZ9kL/cqMdBktGLbZZISNicJXmWBxWCr BXgtv9u0lWnsFDB97ysQ8BrXwFvK1wx3hh4wI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=nanometrics.ca; s=google; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=ae/5zgmLmu49H0/IYQKNzdwtl1avlxJQFuwmIJt8OEGIfXzHel5VX6cfWZHAy/1Zio jEVrQ6HiMoyhClO0m+H+lqJuRcRSreM4ZmYZv0vybfaRen155E3ka5IdnlEUkIt2IsD4 jOtq3HJWKZTBp94jKbyvtLT6sONE2y/CUJIwQ= Received: by 10.52.31.195 with SMTP id c3mr6040148vdi.141.1306263025694; Tue, 24 May 2011 11:50:25 -0700 (PDT) Received: from localhost.localdomain ([206.191.47.130]) by mx.google.com with ESMTPS id d18sm1646004vcs.40.2011.05.24.11.50.23 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 24 May 2011 11:50:25 -0700 (PDT) From: Ben Gardiner To: Mark Brown , Sekhar Nori , Liam Girdwood , alsa-devel@alsa-project.org, davinci-linux-open-source@linux.davincidsp.com Subject: [PATCH 2/6] ASoC: davinci-pcm: expand the .formats Date: Tue, 24 May 2011 14:50:16 -0400 Message-Id: X-Mailer: git-send-email 1.7.4.1 In-Reply-To: References: X-pstn-neptune: 0/0/0.00/0 X-pstn-levels: (S:99.90000/99.90000 CV:99.9000 FC:95.5390 LC:95.5390 R:95.9108 P:95.9108 M:97.0282 C:98.6951 ) X-pstn-settings: 2 (0.5000:0.0750) s cv GT3 gt2 gt1 r p m c X-pstn-addresses: from [db-null] Cc: Steven Faludi X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: davinci-linux-open-source-bounces@linux.davincidsp.com Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com X-Greylist: Sender succeeded STARTTLS authentication, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Tue, 24 May 2011 18:53:01 +0000 (UTC) Based on the data_type test in ping_pong_dma_setup, davinci-pcm is capable of handling data of width up to and including 32bits. " if ((data_type == 0) || (data_type > 4)) { printk(KERN_ERR "%s: data_type=%i\n", __func__, data_type); return -EINVAL; } " Update the .format member of the snd_pcm_hardware instances it registers to reflect this capability. Signed-off-by: Ben Gardiner Reviewed-by: Steven Faludi --- sound/soc/davinci/davinci-pcm.c | 20 ++++++++++++++++++-- 1 files changed, 18 insertions(+), 2 deletions(-) diff --git a/sound/soc/davinci/davinci-pcm.c b/sound/soc/davinci/davinci-pcm.c index 0d04e0c..1e47267 100644 --- a/sound/soc/davinci/davinci-pcm.c +++ b/sound/soc/davinci/davinci-pcm.c @@ -46,11 +46,27 @@ static void print_buf_info(int slot, char *name) } #endif +#define DAVINCI_PCM_FMTBITS (\ + SNDRV_PCM_FMTBIT_S8 |\ + SNDRV_PCM_FMTBIT_U8 |\ + SNDRV_PCM_FMTBIT_S16_LE |\ + SNDRV_PCM_FMTBIT_S16_BE |\ + SNDRV_PCM_FMTBIT_U16_LE |\ + SNDRV_PCM_FMTBIT_U16_BE |\ + SNDRV_PCM_FMTBIT_S24_LE |\ + SNDRV_PCM_FMTBIT_S24_BE |\ + SNDRV_PCM_FMTBIT_U24_LE |\ + SNDRV_PCM_FMTBIT_U24_BE |\ + SNDRV_PCM_FMTBIT_S32_LE |\ + SNDRV_PCM_FMTBIT_S32_BE |\ + SNDRV_PCM_FMTBIT_U32_LE |\ + SNDRV_PCM_FMTBIT_U32_BE) + static struct snd_pcm_hardware pcm_hardware_playback = { .info = (SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME), - .formats = (SNDRV_PCM_FMTBIT_S16_LE), + .formats = DAVINCI_PCM_FMTBITS, .rates = (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 | @@ -72,7 +88,7 @@ static struct snd_pcm_hardware pcm_hardware_capture = { .info = (SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_PAUSE), - .formats = (SNDRV_PCM_FMTBIT_S16_LE), + .formats = DAVINCI_PCM_FMTBITS, .rates = (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 |