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: 1443091 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 9683E3FE79 for ; Wed, 12 Sep 2012 11:49:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756167Ab2ILLtZ (ORCPT ); Wed, 12 Sep 2012 07:49:25 -0400 Received: from na3sys009aog118.obsmtp.com ([74.125.149.244]:48540 "EHLO na3sys009aog118.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754980Ab2ILLqv (ORCPT ); Wed, 12 Sep 2012 07:46:51 -0400 Received: from mail-oa0-f46.google.com ([209.85.219.46]) (using TLSv1) by na3sys009aob118.postini.com ([74.125.148.12]) with SMTP ID DSNKUFB2Kj+u3Q9dlJ31No4yyrMVkk3bDl0i@postini.com; Wed, 12 Sep 2012 04:46:50 PDT Received: by oago6 with SMTP id o6so902397oag.19 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=ZKBhH0l7r+Zo6wjql+8tvlcMVqTbjuneWAkusef9MqN/d73iMIZ73AgFRGlXCJbcqy H/I/Obz7wG0Zk/rLfR/W7JF8W1Dq2Z6TmHEmGLbLX2iuA60D/amvc2dN0SX/PzrMQLyu SsBV5O+oUBhIpNa5WeO+6gBAy16NfoxiKx+sy7tG3f4f3+ygVWzoiscDkYASYV5NGhEP GLkVaFV/y35Evkih589BndeorC6NYspemDh6NjvTMiO9GeFWrU01CS5PWAM46Fuz49Ax aCb+TfMT9gX4F1Tyb0hFGy2WXvH2rOQk8ROR2YLLBfQ3Avn4Hwtr4oKTqDUSV2ph6REH l30g== 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 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 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: ALoCoQkcOF16uvjcVSeTP6bE6LUrnhTQN/Sp+CHunzP5o6PZWOZdTzZRhPLkfjexC8N7neNqoVfs 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;