From patchwork Thu Sep 13 13:37:57 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 1452291 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 1138ADF24C for ; Thu, 13 Sep 2012 13:41:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751541Ab2IMNlI (ORCPT ); Thu, 13 Sep 2012 09:41:08 -0400 Received: from na3sys009aog135.obsmtp.com ([74.125.149.84]:48701 "EHLO na3sys009aog135.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754626Ab2IMNiE (ORCPT ); Thu, 13 Sep 2012 09:38:04 -0400 Received: from mail-ob0-f174.google.com ([209.85.214.174]) (using TLSv1) by na3sys009aob135.postini.com ([74.125.148.12]) with SMTP ID DSNKUFHhuh5X60UFiqDQ09cZuCPp+5+gaZ2v@postini.com; Thu, 13 Sep 2012 06:38:04 PDT Received: by obbuo13 with SMTP id uo13so4469107obb.19 for ; Thu, 13 Sep 2012 06:38:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=0q3nBGxQ4jr7wXFAQ02zYxS39qVUJmdt+qH+5GESoBM=; b=nY6/dRe1rWZNIThYATmciqyYZYPUv7COO2E4xQc3Up5QCSnO7WEQTTREgcSY5NMSdw LAGr7CWNjNa/f544+VFsAhNjIKL8Y/h4GBXDxSIEx4jxHREBjU25v+LWQSo0fqzp9lie NldxlU01cThKEOWL+Cn0TA2dm/QXEY7QXPjIPPjlvlLjhzKL2NXGELBFI0OwonTUgN+F SJdlhDyFDXql5BkE2jIUr7SQwAr6EWZMjsafeRek95X777h/b9kB8c9WT3CmjI2tgh4U XwdweTra9lr3NlaGMQjkrPIaJckCSyNN8jXdN8/dEZOWCvhg/Qj70EFTJhe2qsuHbRcD Ab+g== Received: by 10.60.30.168 with SMTP id t8mr2264774oeh.89.1347543482370; Thu, 13 Sep 2012 06:38:02 -0700 (PDT) Received: from barack.emea.dhcp.ti.com (dragon.ti.com. [192.94.94.33]) by mx.google.com with ESMTPS id n8sm19403567oec.5.2012.09.13.06.37.59 (version=SSLv3 cipher=OTHER); Thu, 13 Sep 2012 06:38:01 -0700 (PDT) From: Peter Ujfalusi To: Mark Brown , Liam Girdwood , Tony Lindgren , Russell King , Vinod Koul , Dan Williams , Jarkko Nikula Cc: alsa-devel@alsa-project.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Janusz Krzysztofik , Ricardo Neri , Lars-Peter Clausen Subject: [PATCH v2 07/15] ASoC: omap-pcm: Select sDMA synchronization based on packet_size Date: Thu, 13 Sep 2012 16:37:57 +0300 Message-Id: <1347543485-339-8-git-send-email-peter.ujfalusi@ti.com> X-Mailer: git-send-email 1.7.12 In-Reply-To: <1347543485-339-1-git-send-email-peter.ujfalusi@ti.com> References: <1347543485-339-1-git-send-email-peter.ujfalusi@ti.com> X-Gm-Message-State: ALoCoQkRiNPxYkj/mhYJpDeFli6a0J5LM1C+OoWXZMTco/IQLfQ7TSi3FfgqqvhMRJDBELTAXIGa Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Since we only have element or packet synchronization we can use the dma_data->packet_size to select the desired mode: if packet_size is 0 we use ELEMENT mode if packet_size is not 0 we use PACKET mode for sDMA synchronization. Signed-off-by: Peter Ujfalusi --- sound/soc/omap/omap-pcm.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sound/soc/omap/omap-pcm.c b/sound/soc/omap/omap-pcm.c index f0feb06..02eeb2e 100644 --- a/sound/soc/omap/omap-pcm.c +++ b/sound/soc/omap/omap-pcm.c @@ -165,7 +165,12 @@ static int omap_pcm_prepare(struct snd_pcm_substream *substream) memset(&dma_params, 0, sizeof(dma_params)); dma_params.data_type = dma_data->data_type; dma_params.trigger = dma_data->dma_req; - dma_params.sync_mode = dma_data->sync_mode; + + if (dma_data->packet_size) + dma_params.sync_mode = OMAP_DMA_SYNC_PACKET; + else + dma_params.sync_mode = OMAP_DMA_SYNC_ELEMENT; + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { dma_params.src_amode = OMAP_DMA_AMODE_POST_INC; dma_params.dst_amode = OMAP_DMA_AMODE_CONSTANT;