From patchwork Mon Jun 23 00:59:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 4397201 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 C1D6B9F26E for ; Mon, 23 Jun 2014 01:02:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 07A2F2024F for ; Mon, 23 Jun 2014 01:02:39 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id CD707201F7 for ; Mon, 23 Jun 2014 01:02:37 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id C0EE3265531; Mon, 23 Jun 2014 03:02:36 +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 4E6BC265531; Mon, 23 Jun 2014 03:00:47 +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 78C38265531; Mon, 23 Jun 2014 03:00:46 +0200 (CEST) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by alsa0.perex.cz (Postfix) with ESMTP id 18E12265584 for ; Mon, 23 Jun 2014 02:59:03 +0200 (CEST) Received: by mail-pb0-f54.google.com with SMTP id un15so5164198pbc.41 for ; Sun, 22 Jun 2014 17:59:03 -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=FmG0BoTaz+OUqBWdNH0/S/+tCg69a0ikd30SOPJLX4s=; b=VaL7U5OZfooTVJJmhvKd5PAU3U++dL9L6tpbwmX2g3+3lLyrxTFk5/OnY+e/ryQ3nL pmrL/ODdrC6Un3CK2O7yfQveOsWqq5NUgryL+EyvpzxoVFMGVJz2gnLbSr3Sn1yw7XWX DVwwRQ/43HIHfvuxdLl0jVB7d83djaEViHIdAh2w4zRXLgk8ukZNIGzgyRHrN3GZ37VX G8HxNTN8SLfdlIi5nnWg5RGU21F6KGWVEQC4n1qGM8O2+jWrL9nFyyG224Ls0Kv4Jv4z AqVhgnGy87Z16BgVOSJYcN4puTR6vKTizn/2keA78Jdz6zRYbicm/8EmpNp1Ye3Q9i3a kXcg== X-Received: by 10.68.133.229 with SMTP id pf5mr24870822pbb.115.1403485142922; Sun, 22 Jun 2014 17:59: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 ih6sm23918358pbc.22.2014.06.22.17.59.01 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 22 Jun 2014 17:59:02 -0700 (PDT) Date: Sun, 22 Jun 2014 17:59:02 -0700 (PDT) Message-ID: <87simwsap0.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: <8761jstphc.wl%kuninori.morimoto.gx@gmail.com> References: <87d2e6zjhf.wl%kuninori.morimoto.gx@gmail.com> <8761jstphc.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 09/10 v2] 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 --- v1 -> v2 - based on latest mark/topic/rcar 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 4435a31e..49d9b31 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_MEM_TO_DEV : DMA_DEV_TO_MEM; return 0; diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h index 425b22e..631b149 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_transfer_direction dir; + dma_addr_t addr; }; void rsnd_dma_start(struct rsnd_dma *dma);