From patchwork Tue Feb 17 01:48:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 5835781 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 E8BC69F373 for ; Tue, 17 Feb 2015 01:48:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 26094201FA for ; Tue, 17 Feb 2015 01:48:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3CFEC20219 for ; Tue, 17 Feb 2015 01:48:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751582AbbBQBsY (ORCPT ); Mon, 16 Feb 2015 20:48:24 -0500 Received: from relmlor2.renesas.com ([210.160.252.172]:54169 "EHLO relmlie1.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751552AbbBQBsY (ORCPT ); Mon, 16 Feb 2015 20:48:24 -0500 Received: from unknown (HELO relmlir1.idc.renesas.com) ([10.200.68.151]) by relmlie1.idc.renesas.com with ESMTP; 17 Feb 2015 10:48:23 +0900 Received: from relmlac3.idc.renesas.com (relmlac3.idc.renesas.com [10.200.69.23]) by relmlir1.idc.renesas.com (Postfix) with ESMTP id 6A8A14BD34; Tue, 17 Feb 2015 10:48:22 +0900 (JST) Received: by relmlac3.idc.renesas.com (Postfix, from userid 0) id 4F0231800A; Tue, 17 Feb 2015 10:48:22 +0900 (JST) Received: from relmlac3.idc.renesas.com (localhost [127.0.0.1]) by relmlac3.idc.renesas.com (Postfix) with ESMTP id 4360318070; Tue, 17 Feb 2015 10:48:22 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac3.idc.renesas.com with ESMTP id LAB03624; Tue, 17 Feb 2015 10:48:22 +0900 X-IronPort-AV: E=Sophos;i="5.09,591,1418050800"; d="scan'208";a="179964618" Received: from mail-hk1lp0122.outbound.protection.outlook.com (HELO APAC01-HK1-obe.outbound.protection.outlook.com) ([207.46.51.122]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 17 Feb 2015 10:48:21 +0900 Received: from HKXPR06MB165.apcprd06.prod.outlook.com (10.242.124.16) by HKXPR06MB389.apcprd06.prod.outlook.com (10.141.136.147) with Microsoft SMTP Server (TLS) id 15.1.87.18; Tue, 17 Feb 2015 01:48:21 +0000 Received: from remon.renesas.com (211.11.155.132) by HKXPR06MB165.apcprd06.prod.outlook.com (10.242.124.16) with Microsoft SMTP Server (TLS) id 15.1.87.18; Tue, 17 Feb 2015 01:48:19 +0000 Message-ID: <87r3tps3ww.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 8/8 v5] ASoC: fsi: Configure DMA slave settings User-Agent: Wanderlust/2.14.0 Emacs/23.3 Mule/6.0 MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") To: Vinod Koul CC: Ulf Hansson , Mark Brown , Mark Brown , Arnd Bergmann , Simon , Linux-SH , Laurent , In-Reply-To: <873865tiks.wl%kuninori.morimoto.gx@renesas.com> References: <87ppafxy1f.wl%kuninori.morimoto.gx@renesas.com> <873865tiks.wl%kuninori.morimoto.gx@renesas.com> Date: Tue, 17 Feb 2015 01:48:19 +0000 X-Originating-IP: [211.11.155.132] X-ClientProxiedBy: HKNPR06CA0056.apcprd06.prod.outlook.com (10.141.16.46) To HKXPR06MB165.apcprd06.prod.outlook.com (10.242.124.16) Authentication-Results: intel.com; dkim=none (message not signed) header.d=none; X-Microsoft-Antispam: UriScan:;UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:HKXPR06MB165; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005003); SRVR:HKXPR06MB165; X-Forefront-PRVS: 0490BBA1F0 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(86362001)(66066001)(46406003)(33646002)(50466002)(23726002)(42186005)(47776003)(40100003)(77096005)(53416004)(46102003)(83506001)(62966003)(229853001)(19580405001)(2950100001)(87976001)(92566002)(110136001)(19580395003)(77156002)(76176999)(54356999)(122386002)(50986999)(36756003); DIR:OUT; SFP:1102; SCL:1; SRVR:HKXPR06MB165; H:remon.renesas.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:;SRVR:HKXPR06MB165; X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Feb 2015 01:48:19.3213 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HKXPR06MB165 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:HKXPR06MB389; X-OriginatorOrg: renesas.com 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=unavailable 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 From: Kuninori Morimoto Current FSI driver is assuming that dst_addr/src_addr of DMAEngine will be set by platform data. But it should be set via dmaengine_slave_config(). Special thanks to Arnd Reported-by: Arnd Bergmann Signed-off-by: Kuninori Morimoto Acked-by: Mark Brown --- v4 -> v5 - no change sound/soc/sh/fsi.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c index dc28b03..bb20550 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; + phys_addr_t phys; struct fsi_master *master; struct fsi_stream playback; @@ -1374,9 +1375,15 @@ static int fsi_dma_probe(struct fsi_priv *fsi, struct fsi_stream *io, struct dev struct dma_slave_config cfg = {}; int ret; - 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; + if (is_play) { + cfg.dst_addr = fsi->phys + REG_DODT; + cfg.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; + cfg.direction = DMA_MEM_TO_DEV; + } else { + cfg.src_addr = fsi->phys + REG_DIDT; + cfg.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; + cfg.direction = DMA_DEV_TO_MEM; + } ret = dmaengine_slave_config(io->chan, &cfg); if (ret < 0) { @@ -1940,6 +1947,7 @@ static int fsi_probe(struct platform_device *pdev) /* FSI A setting */ fsi = &master->fsia; fsi->base = master->base; + fsi->phys = res->start; fsi->master = master; fsi_port_info_init(fsi, &info.port_a); fsi_handler_init(fsi, &info.port_a); @@ -1952,6 +1960,7 @@ static int fsi_probe(struct platform_device *pdev) /* FSI B setting */ fsi = &master->fsib; fsi->base = master->base + 0x40; + fsi->phys = res->start + 0x40; fsi->master = master; fsi_port_info_init(fsi, &info.port_b); fsi_handler_init(fsi, &info.port_b);