From patchwork Wed Sep 12 11:46:59 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 1443181 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (unknown [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 5CC3CDF28C for ; Wed, 12 Sep 2012 11:57:04 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TBlPd-0006SB-4n; Wed, 12 Sep 2012 11:47:21 +0000 Received: from na3sys009aog101.obsmtp.com ([74.125.149.67]) by merlin.infradead.org with smtps (Exim 4.76 #1 (Red Hat Linux)) id 1TBlP9-0006MA-RV for linux-arm-kernel@lists.infradead.org; Wed, 12 Sep 2012 11:46:52 +0000 Received: from mail-ob0-f177.google.com ([209.85.214.177]) (using TLSv1) by na3sys009aob101.postini.com ([74.125.148.12]) with SMTP ID DSNKUFB2Kj+u3Q9dlJ31No4yyrMVkk3bDl0i@postini.com; Wed, 12 Sep 2012 04:46:51 PDT Received: by obbta17 with SMTP id ta17so2564802obb.36 for ; Wed, 12 Sep 2012 04:46:49 -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=Unlr+YhPU1j2BP/ROFsYDWLunoVqSYZ0Ld5z5pocL79b04+U9mU23gJsIZCLt8HOCZ bwNJ9bRfvrpgqwgMQEG1ziq9Qy27mkEzhDSgdDB/vthVGKNsK3IdbiyKLp0ab9Jlrsm6 v9d3IcWeuSIZ9yuDBmzwRP/g11VKeKd28hxJoykLvWHIpl+jZjpWAnfEBIppvOZBzuXP 8m5O8pdi99gEKFy65AZlYjefZZPnwbAWa6gDJ/ExnFURZFk7ucufR4QrjR85WjXB7WU0 XBXmqvsScRAgiXOW4CpBSOIaUiasuwXOB48Oa7fXD9HMSuEYw0u6tHDSfqrWqLaripuM ub6Q== Received: by 10.182.146.46 with SMTP id sz14mr21618352obb.76.1347450409871; Wed, 12 Sep 2012 04:46:49 -0700 (PDT) Received: from barack.emea.dhcp.ti.com (dragon.ti.com. [192.94.94.33]) by mx.google.com with ESMTPS id c6sm19835570obd.22.2012.09.12.04.46.46 (version=SSLv3 cipher=OTHER); Wed, 12 Sep 2012 04:46:49 -0700 (PDT) From: Peter Ujfalusi To: Mark Brown , Liam Girdwood , Tony Lindgren , Russell King , Vinod Koul , Dan Williams , Jarkko Nikula Subject: [PATCH 03/11] ASoC: omap-pcm: Select sDMA synchronization based on packet_size Date: Wed, 12 Sep 2012 14:46:59 +0300 Message-Id: <1347450427-27627-4-git-send-email-peter.ujfalusi@ti.com> X-Mailer: git-send-email 1.7.12 In-Reply-To: <1347450427-27627-1-git-send-email-peter.ujfalusi@ti.com> References: <1347450427-27627-1-git-send-email-peter.ujfalusi@ti.com> X-Gm-Message-State: ALoCoQlXTDzOyIfVA6fWNjoILlA1+EFpQTtziGQmafdQoY77q3GXcWbyoji1j7BRcwtwFFUPwG5D X-Spam-Note: CRM114 invocation failed X-Spam-Score: -4.2 (----) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-4.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [74.125.149.67 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: alsa-devel@alsa-project.org, Janusz Krzysztofik , Ricardo Neri , linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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;