From patchwork Wed Jun 18 08:54:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 4374081 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 9993E9F3B4 for ; Wed, 18 Jun 2014 08:55:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B69DC202DD for ; Wed, 18 Jun 2014 08:55:12 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 8520720218 for ; Wed, 18 Jun 2014 08:55:11 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id F02D52619E9; Wed, 18 Jun 2014 10:55:09 +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, NO_DNS_FOR_FROM, 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 B099D261643; Wed, 18 Jun 2014 10:54:59 +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 7BB7726166B; Wed, 18 Jun 2014 10:54:58 +0200 (CEST) Received: from mail-pa0-f53.google.com (mail-pa0-f53.google.com [209.85.220.53]) by alsa0.perex.cz (Postfix) with ESMTP id 4FC89261615 for ; Wed, 18 Jun 2014 10:54:44 +0200 (CEST) Received: by mail-pa0-f53.google.com with SMTP id ey11so527956pad.12 for ; Wed, 18 Jun 2014 01:54:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:message-id:from:subject:user-agent:to:cc:in-reply-to :references:mime-version:content-type; bh=wd+aPDRjCSyZor5Rwm07FKgfa6Bi6AokZXvAfyhzWQI=; b=ROVtnA/G4cHoGRN5VR3XJ+qgDgaVB2+qH7+oHLdVLMTmsCQDX06sSL0XakRBQOAbDf vdQrxuFrRRCp8TB5qSL2NIDK2uKVRp5iFDuPVJ/aB1YtO0rp/bXHp18qkB1Nu5gH8Gt1 ArWgk5Pl5V8lvJcn5QmIHee+gZJTJA0kygokQW51wrMZQfjqpQD0FYEfLQllM+GGjFb8 vZGrl5XdwDk4relGIwoT3AUHgjA0aI8Bw6Qk220a8wCWCddQJFXHimvjAYIfkRzPuQQd TI9uDsP+GDKqgplN7oNfWmSOuWM4kYgjpypAKHniqKl/+u/ddjD3x1yb9G8szQXYph3N e45g== X-Received: by 10.66.236.5 with SMTP id uq5mr845603pac.122.1403081683005; Wed, 18 Jun 2014 01:54:43 -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 vs10sm2255284pbc.38.2014.06.18.01.54.41 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 18 Jun 2014 01:54:42 -0700 (PDT) Date: Wed, 18 Jun 2014 17:54:43 +0900 Message-ID: <87bntqzjfw.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 01/12] ASoC: rsnd: fixup rsnd_gen_dma_addr() for Gen1 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 ad32d0c7b0e993433df152ae747652647eb65a27 (ASoC: rsnd: add rsnd_gen_dma_addr() for DMAC addr) added rsnd_gen_dma_addr() to calculate DMA addr, but, it is necessary only for Gen2. This patch ignores Gen1 case. Kernel will be panic without this patch. Special thanks to Simon Reported-by: Simon Horman Signed-off-by: Kuninori Morimoto --- sound/soc/sh/rcar/gen.c | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/sound/soc/sh/rcar/gen.c b/sound/soc/sh/rcar/gen.c index 1dd2b7d..0280a11 100644 --- a/sound/soc/sh/rcar/gen.c +++ b/sound/soc/sh/rcar/gen.c @@ -184,7 +184,7 @@ static int rsnd_gen_regmap_init(struct rsnd_priv *priv, #define RDMA_CMD_O_N(addr, i) (addr ##_reg - 0x004f8000 + (0x400 * i)) #define RDMA_CMD_O_P(addr, i) (addr ##_reg - 0x001f8000 + (0x400 * i)) -void rsnd_gen_dma_addr(struct rsnd_priv *priv, +static void rsnd_gen2_dma_addr(struct rsnd_priv *priv, struct rsnd_dma *dma, struct dma_slave_config *cfg, int is_play, int slave_id) @@ -226,17 +226,6 @@ void rsnd_gen_dma_addr(struct rsnd_priv *priv, } }; - cfg->slave_id = slave_id; - cfg->src_addr = 0; - cfg->dst_addr = 0; - cfg->direction = is_play ? DMA_MEM_TO_DEV : DMA_DEV_TO_MEM; - - /* - * gen1 uses default DMA addr - */ - if (rsnd_is_gen1(priv)) - return; - /* it shouldn't happen */ if (use_dvc & !use_src) { dev_err(dev, "DVC is selected without SRC\n"); @@ -250,6 +239,26 @@ void rsnd_gen_dma_addr(struct rsnd_priv *priv, id, cfg->src_addr, cfg->dst_addr); } +void rsnd_gen_dma_addr(struct rsnd_priv *priv, + struct rsnd_dma *dma, + struct dma_slave_config *cfg, + int is_play, int slave_id) +{ + cfg->slave_id = slave_id; + cfg->src_addr = 0; + cfg->dst_addr = 0; + cfg->direction = is_play ? DMA_MEM_TO_DEV : DMA_DEV_TO_MEM; + + /* + * gen1 uses default DMA addr + */ + if (rsnd_is_gen1(priv)) + return; + + rsnd_gen2_dma_addr(priv, dma, cfg, is_play, slave_id); +} + + /* * Gen2 */