From patchwork Fri Sep 14 12:05:46 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 1458071 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 8F554402E1 for ; Fri, 14 Sep 2012 12:09:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759531Ab2INMF4 (ORCPT ); Fri, 14 Sep 2012 08:05:56 -0400 Received: from na3sys009aog128.obsmtp.com ([74.125.149.141]:37935 "EHLO na3sys009aog128.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759481Ab2INMFl (ORCPT ); Fri, 14 Sep 2012 08:05:41 -0400 Received: from mail-ob0-f174.google.com ([209.85.214.174]) (using TLSv1) by na3sys009aob128.postini.com ([74.125.148.12]) with SMTP ID DSNKUFMdlMa2Ys6kw6tR/RCcBU8E729RhPb5@postini.com; Fri, 14 Sep 2012 05:05:41 PDT Received: by obbuo13 with SMTP id uo13so6097026obb.19 for ; Fri, 14 Sep 2012 05:05:40 -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=WPbDP0njoWIbSQJIYUpiU8JHEPnbvd5gmOL24BEMNNU=; b=QQuhi48DNYf1c8CMAsuyS4WzBBwMoXIldAm+t0fH1B9556JMFmvKMvcOY2zChADW1f hVI3V7CbhMOKDYi6jonCrrHJ9DhpZTN7DA7cIiJBAO0P9fkTi8lUye0nZYFuwNMPOd2q fDdkMd7O2ZJ8CHnwM3k8aP1LGj1MyHgDKZnCxJ6Bg0iqQ9PKGRcCs5y6rgCYfyZWDl5E qBRGm5ARckS7lPqQvhyrRwFeO4m+0I2dustFz5oYrVM6Pe3FWozM1qq+jyZBCAXvVz4f 4rN5Oavz/YtWCLWXi1FByl9iDUdfynko/dFBNSIAHeAS/D6AgUxCRVQbWIoCh/XDjTGT o9Xg== Received: by 10.60.22.162 with SMTP id e2mr2679770oef.35.1347624340158; Fri, 14 Sep 2012 05:05:40 -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.36 (version=SSLv3 cipher=OTHER); Fri, 14 Sep 2012 05:05:39 -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 03/15] dmaengine: Add flags parameter to dmaengine_prep_dma_cyclic() Date: Fri, 14 Sep 2012 15:05:46 +0300 Message-Id: <1347624358-25582-4-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: ALoCoQmPsFIBNrdtUi/sf3a5K6odgq4Jqc5fSbqMXCNADhlM97/cfwhVglJGEQZV/oeKrmBrRXak Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org With this parameter added to dmaengine_prep_dma_cyclic() the API will be in sync with other dmaengine_prep_*() functions. The dmaengine_prep_dma_cyclic() function primarily used by audio for cyclic transfer required by ALSA, we use the from audio to ask dma drivers to suppress interrupts (if DMA_PREP_INTERRUPT is cleared) when it is supported on the platform. Signed-off-by: Peter Ujfalusi CC: Lars-Peter Clausen Acked-by: Vinod Koul --- include/linux/dmaengine.h | 3 ++- sound/soc/soc-dmaengine-pcm.c | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index 9c02a45..2abcac5 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h @@ -653,7 +653,8 @@ static inline struct dma_async_tx_descriptor *dmaengine_prep_rio_sg( static inline struct dma_async_tx_descriptor *dmaengine_prep_dma_cyclic( struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len, - size_t period_len, enum dma_transfer_direction dir) + size_t period_len, enum dma_transfer_direction dir, + unsigned long flags) { return chan->device->device_prep_dma_cyclic(chan, buf_addr, buf_len, period_len, dir, NULL); diff --git a/sound/soc/soc-dmaengine-pcm.c b/sound/soc/soc-dmaengine-pcm.c index 5df529e..bbc1257 100644 --- a/sound/soc/soc-dmaengine-pcm.c +++ b/sound/soc/soc-dmaengine-pcm.c @@ -140,14 +140,18 @@ static int dmaengine_pcm_prepare_and_submit(struct snd_pcm_substream *substream) struct dma_chan *chan = prtd->dma_chan; struct dma_async_tx_descriptor *desc; enum dma_transfer_direction direction; + unsigned long flags = DMA_CTRL_ACK; direction = snd_pcm_substream_to_dma_direction(substream); + if (!substream->runtime->no_period_wakeup) + flags |= DMA_PREP_INTERRUPT; + prtd->pos = 0; desc = dmaengine_prep_dma_cyclic(chan, substream->runtime->dma_addr, snd_pcm_lib_buffer_bytes(substream), - snd_pcm_lib_period_bytes(substream), direction); + snd_pcm_lib_period_bytes(substream), direction, flags); if (!desc) return -ENOMEM;