From patchwork Fri Sep 14 12:05:50 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 1458041 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 78B27DF280 for ; Fri, 14 Sep 2012 12:09:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759568Ab2INMJP (ORCPT ); Fri, 14 Sep 2012 08:09:15 -0400 Received: from na3sys009aog129.obsmtp.com ([74.125.149.142]:38892 "EHLO na3sys009aog129.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759471Ab2INMGC (ORCPT ); Fri, 14 Sep 2012 08:06:02 -0400 Received: from mail-ob0-f174.google.com ([209.85.214.174]) (using TLSv1) by na3sys009aob129.postini.com ([74.125.148.12]) with SMTP ID DSNKUFMdqSHtjV4DNtZ9g1Ggb9gVsDYkR7YC@postini.com; Fri, 14 Sep 2012 05:06:02 PDT Received: by obbuo13 with SMTP id uo13so6097448obb.19 for ; Fri, 14 Sep 2012 05:06:01 -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=QHp5wzUZKtgyk4sIgVLIPbOLLS3YtsxS7YYrzoacEmNnC2yMu124hPKqVqK2vPaVX9 tkx7fcGg9gEWlQmPGvJVLUfawiFISs93rztJXKpEwsgZ4qmp7fceIKUUh9+D+ka4gSut uWCwb6bbKhpnpX40whdwH1P857fQJj2LRS0+Q8AbtkeZuYmWwhKAMp/CZCGQ087c/1Tw SuiVWMs1HenxTpgiBFVRAOM1yOpUv71zr5OcvLoNh+/brW81RzY2OuRRo7TbNjlwNkUG P1DhYjopPlEgxkWw8xWi8WAn/WQfbn3L0qtjrHLHXMUtVMunBJDdUORtxpGAYoeq3ZwU EiBA== Received: by 10.60.0.194 with SMTP id 2mr2527345oeg.108.1347624361180; Fri, 14 Sep 2012 05:06:01 -0700 (PDT) Received: from barack.emea.dhcp.ti.com (dragon.ti.com. [192.94.94.33]) by mx.google.com with ESMTPS id ac10sm1615600obc.7.2012.09.14.05.05.57 (version=SSLv3 cipher=OTHER); Fri, 14 Sep 2012 05:06:00 -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 v3 07/15] ASoC: omap-pcm: Select sDMA synchronization based on packet_size Date: Fri, 14 Sep 2012 15:05:50 +0300 Message-Id: <1347624358-25582-8-git-send-email-peter.ujfalusi@ti.com> X-Mailer: git-send-email 1.7.12 In-Reply-To: <1347624358-25582-1-git-send-email-peter.ujfalusi@ti.com> References: <1347624358-25582-1-git-send-email-peter.ujfalusi@ti.com> X-Gm-Message-State: ALoCoQkxWNq7LLiudVRVTrYhtCW8GpX0kCJZ01IvpCL0YxtsO2tQI5IFO+80ndNwOnjjSFvWgkCK 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;