From patchwork Wed Jun 18 08:57:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 4374491 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A884E9F433 for ; Wed, 18 Jun 2014 09:02:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A8378200FF for ; Wed, 18 Jun 2014 09:02:55 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 402762020F for ; Wed, 18 Jun 2014 09:02:54 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 666A4265794; Wed, 18 Jun 2014 11:02:53 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id D7FEA2656C9; Wed, 18 Jun 2014 10:58:18 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 971242656C9; Wed, 18 Jun 2014 10:58:17 +0200 (CEST) Received: from mail-pd0-f175.google.com (mail-pd0-f175.google.com [209.85.192.175]) by alsa0.perex.cz (Postfix) with ESMTP id 530F72656DE for ; Wed, 18 Jun 2014 10:57:03 +0200 (CEST) Received: by mail-pd0-f175.google.com with SMTP id v10so492140pde.20 for ; Wed, 18 Jun 2014 01:57:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:sender:message-id:from:subject:user-agent:to:cc:in-reply-to :references:mime-version:content-type; bh=5rnWnNsThUt++6bun/4mGsaKbbsS4T7WPnfwLWUlBX8=; b=TyWWwJvMqeyfW2wXofK73PAQL/ae8qSQ7LtrjFiRYkWz3WJby/2zszPgx4CdZ/XelX 7fed41WRHPQzThIt2BKjQqpCdDdJsqlVIRmOy9JvbJpkoQkFChGW+7pHjXaFQqtI92XO s25fs4XIjp7ms7CRw33dqlyAM6uNhfIX0QzJh5DOZqi1L4Y2V9KEVxTFnyAWEhY5FEcb CWDjQoK9UcJzT4bHP+8BUxPKfUF41KGDt310JBZDukvytqfVEmwDBU55A+K//jQqHpNZ mqR1NwAzBbcgT1XMW6Tsj6H6aaYvVNrld27tOlmVxr7DTyxUu2wKiOVhCcHp8wb5aE1O /Rjw== X-Received: by 10.66.100.163 with SMTP id ez3mr648396pab.155.1403081822133; Wed, 18 Jun 2014 01:57:02 -0700 (PDT) Received: from remon.gmail.com (49.14.32.202.bf.2iij.net. [202.32.14.49]) by mx.google.com with ESMTPSA id pn4sm2277515pbb.7.2014.06.18.01.57.00 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 18 Jun 2014 01:57:01 -0700 (PDT) Date: Wed, 18 Jun 2014 01:57:01 -0700 (PDT) Message-ID: <87wqcey4rl.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.14.0 Emacs/23.3 Mule/6.0 To: Mark Brown In-Reply-To: <87d2e6zjhf.wl%kuninori.morimoto.gx@gmail.com> References: <87d2e6zjhf.wl%kuninori.morimoto.gx@gmail.com> MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Cc: linux-sh@vger.kernel.org, Linux-ALSA , Simon , Kuninori Morimoto , Liam Girdwood Subject: [alsa-devel] [PATCH 11/12] ASoC: rsnd: DMA start address is properly used for each DMAC X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto R-Car sound uses Audio DMAC and Audio DMAC peri peri. Audio DMAC peri peri transfers data inside circuit. DMA transfer needs source / destination address, and destination address can be set via dmaengine_slave_config(). The source address can be set when starting DMAEngine. Because Audio DMAC peri peri always ignores its value, current driver always used same source address for Audio DMAC / Audio DMAC peri peri (Audio DMAC peri peri source / destination address is always fixed value) But, This is not good match for DT booting. This patch properly uses DMA start address for Audio DMAC / Audio DMAC peri peri. Signed-off-by: Kuninori Morimoto --- sound/soc/sh/rcar/core.c | 2 ++ sound/soc/sh/rcar/rsnd.h | 1 + 2 files changed, 3 insertions(+) diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c index 36895eb..6fb89fc 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c @@ -200,6 +200,7 @@ void rsnd_dma_start(struct rsnd_dma *dma) struct dma_async_tx_descriptor *desc; desc = dmaengine_prep_dma_cyclic(dma->chan, + (dma->addr) ? dma->addr : substream->runtime->dma_addr, snd_pcm_lib_buffer_bytes(substream), snd_pcm_lib_period_bytes(substream), @@ -347,6 +348,7 @@ int rsnd_dma_init(struct rsnd_priv *priv, struct rsnd_dma *dma, if (ret < 0) goto rsnd_dma_init_err; + dma->addr = is_play ? cfg.src_addr : cfg.dst_addr; dma->dir = is_play ? DMA_TO_DEVICE : DMA_FROM_DEVICE; return 0; diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h index 70a91b0..f75c535 100644 --- a/sound/soc/sh/rcar/rsnd.h +++ b/sound/soc/sh/rcar/rsnd.h @@ -158,6 +158,7 @@ struct rsnd_dma { struct sh_dmae_slave slave; struct dma_chan *chan; enum dma_data_direction dir; + dma_addr_t addr; }; void rsnd_dma_start(struct rsnd_dma *dma);