From patchwork Tue Jan 20 13:02:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 5669461 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 454D99F358 for ; Tue, 20 Jan 2015 13:02:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5E81220328 for ; Tue, 20 Jan 2015 13:02:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3392620306 for ; Tue, 20 Jan 2015 13:02:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754821AbbATNC4 (ORCPT ); Tue, 20 Jan 2015 08:02:56 -0500 Received: from mout.kundenserver.de ([212.227.17.13]:54598 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754119AbbATNCz (ORCPT ); Tue, 20 Jan 2015 08:02:55 -0500 Received: from wuerfel.localnet ([149.172.15.242]) by mrelayeu.kundenserver.de (mreue101) with ESMTPSA (Nemesis) id 0LsQ2q-1Xl4Ek10KO-0120Ab; Tue, 20 Jan 2015 14:02:42 +0100 From: Arnd Bergmann To: Kuninori Morimoto Cc: Vinod Koul , Ulf Hansson , Brian Norris , Mark Brown , Mark Brown , dmaengine@vger.kernel.org, Simon , Rob Herring , Linux-SH , Laurent Subject: Re: [PATCH 7/8 v2] ASoC: fsi: remove slave_id settings for DMAEngine Date: Tue, 20 Jan 2015 14:02:39 +0100 Message-ID: <4060965.ckzs3UAxrx@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <87bnluaxtt.wl%kuninori.morimoto.gx@renesas.com> References: <87ppafxy1f.wl%kuninori.morimoto.gx@renesas.com> <87lhkyaxzs.wl%kuninori.morimoto.gx@renesas.com> <87bnluaxtt.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 X-Provags-ID: V03:K0:icDEw/LuniUB/BsvnwlQd9AfRNllP9q0FkgJ/5CyTC4Zax8e+Iq VPmQb2ydYQGCBQZ10vbPXCdKm+3iRmgPT6syeW8ORiXsf46KJJEXDdyz0dmSfcMsZSMsxc4 F322jN7xVHNDldGqC7wWLYpJq97AABlKNOy35oa5RX09lSSN6gobTm+mdN4XiEsCG4mcV/C k09/dKvUwTaJi755O00vA== X-UI-Out-Filterresults: notjunk:1; Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Tuesday 20 January 2015 04:18:17 Kuninori Morimoto wrote: > diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c > index 8869971..c4eb234 100644 > --- a/sound/soc/sh/fsi.c > +++ b/sound/soc/sh/fsi.c > @@ -1374,10 +1374,9 @@ static int fsi_dma_probe(struct fsi_priv *fsi, struct fsi_stream *io, struct dev > shdma_chan_filter, (void *)io->dma_id, > dev, is_play ? "tx" : "rx"); > if (io->chan) { > - struct dma_slave_config cfg; > + struct dma_slave_config cfg = {}; > int ret; > > - cfg.slave_id = io->dma_id; > cfg.dst_addr = 0; /* use default addr */ > cfg.src_addr = 0; /* use default addr */ > cfg.direction = is_play ? DMA_MEM_TO_DEV : DMA_DEV_TO_MEM; As the dma_slave_config structure is now initialized to all-zeroes, the two address assignments are not strictly required any more. However, I also suspect that that particular initialization to zero is also incorrect: When booting with DT, the dst_addr/src_addr fields are no longer passed in the platform data for the DMA engine but are expected to be set by the slave driver. Also set the correct address width, which has the same problem. Arnd 8<--- ASoC: fsi: use correct FIFO address for DMA Passing the FIFO address using platform data is deprecated and does not work with devicetree due to the lack of that platform data, so the fsi driver should instead fill the correct address itself. Signed-off-by: Arnd Bergmann --- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c index b87b22e88e43..9d5f1f7d0b8c 100644 --- a/sound/soc/sh/fsi.c +++ b/sound/soc/sh/fsi.c @@ -250,6 +250,7 @@ struct fsi_clk { struct fsi_priv { void __iomem *base; + resource_size_t phys; struct fsi_master *master; struct fsi_stream playback; @@ -294,6 +295,7 @@ struct fsi_core { struct fsi_master { void __iomem *base; + resource_size_t phys; struct fsi_priv fsia; struct fsi_priv fsib; const struct fsi_core *core; @@ -1375,8 +1377,10 @@ static int fsi_dma_probe(struct fsi_priv *fsi, struct fsi_stream *io, struct dev int ret; cfg.slave_id = io->dma_id; - cfg.dst_addr = 0; /* use default addr */ - cfg.src_addr = 0; /* use default addr */ + cfg.dst_addr = is_play ? fsi->phys + REG_DODT : 0; + cfg.src_addr = is_play ? 0 : fsi->phys + REG_DIDT; + cfg.dst_addr_width = is_play ? DMA_SLAVE_BUSWIDTH_4_BYTES : 0; + cfg.src_addr_width = is_play ? 0 : DMA_SLAVE_BUSWIDTH_4_BYTES; cfg.direction = is_play ? DMA_MEM_TO_DEV : DMA_DEV_TO_MEM; ret = dmaengine_slave_config(io->chan, &cfg); @@ -1929,6 +1931,7 @@ static int fsi_probe(struct platform_device *pdev) master->base = devm_ioremap_nocache(&pdev->dev, res->start, resource_size(res)); + master->phys = res->start; if (!master->base) { dev_err(&pdev->dev, "Unable to ioremap FSI registers.\n"); return -ENXIO; @@ -1941,6 +1944,7 @@ static int fsi_probe(struct platform_device *pdev) /* FSI A setting */ fsi = &master->fsia; fsi->base = master->base; + fsi->phys = master->phys; fsi->master = master; fsi_port_info_init(fsi, &info.port_a); fsi_handler_init(fsi, &info.port_a); @@ -1953,6 +1957,7 @@ static int fsi_probe(struct platform_device *pdev) /* FSI B setting */ fsi = &master->fsib; fsi->base = master->base + 0x40; + fsi->phys = master->phys + 0x40; fsi->master = master; fsi_port_info_init(fsi, &info.port_b); fsi_handler_init(fsi, &info.port_b);