From patchwork Thu Jan 29 01:04:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 5732731 Return-Path: X-Original-To: patchwork-dmaengine@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 0FCE69F1AF for ; Thu, 29 Jan 2015 01:09:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C816A2011D for ; Thu, 29 Jan 2015 01:09:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D202A2024F for ; Thu, 29 Jan 2015 01:09:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752651AbbA2BJT (ORCPT ); Wed, 28 Jan 2015 20:09:19 -0500 Received: from relmlor4.renesas.com ([210.160.252.174]:55816 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752641AbbA2BJQ (ORCPT ); Wed, 28 Jan 2015 20:09:16 -0500 Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie3.idc.renesas.com with ESMTP; 29 Jan 2015 10:04:13 +0900 Received: from relmlac4.idc.renesas.com (relmlac4.idc.renesas.com [10.200.69.24]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id 5543D44E6C; Thu, 29 Jan 2015 10:04:13 +0900 (JST) Received: by relmlac4.idc.renesas.com (Postfix, from userid 0) id 5A0A0480A5; Thu, 29 Jan 2015 10:04:13 +0900 (JST) Received: from relmlac4.idc.renesas.com (localhost [127.0.0.1]) by relmlac4.idc.renesas.com (Postfix) with ESMTP id 55EB7480A3; Thu, 29 Jan 2015 10:04:13 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac4.idc.renesas.com with ESMTP id LAA23154; Thu, 29 Jan 2015 10:04:13 +0900 X-IronPort-AV: E=Sophos;i="5.09,483,1418050800"; d="scan'208";a="179810283" Received: from mail-sg1lp0085.outbound.protection.outlook.com (HELO APAC01-SG1-obe.outbound.protection.outlook.com) ([207.46.51.85]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 29 Jan 2015 10:04:11 +0900 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.75.20; Thu, 29 Jan 2015 01:04:09 +0000 Message-ID: <878ugmtn0b.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 9/9 v4] ASoC: fsi: Configure DMA slave settings User-Agent: Wanderlust/2.14.0 Emacs/23.3 Mule/6.0 To: Vinod Koul , Mark Brown , Mark Brown CC: Ulf Hansson , Arnd Bergmann , Simon , Linux-SH , Laurent , In-Reply-To: <87lhkmtn7c.wl%kuninori.morimoto.gx@renesas.com> References: <87ppafxy1f.wl%kuninori.morimoto.gx@renesas.com> <87lhkmtn7c.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Date: Thu, 29 Jan 2015 01:04:09 +0000 X-Originating-IP: [211.11.155.132] X-ClientProxiedBy: SINPR01CA0032.apcprd01.prod.exchangelabs.com (10.141.109.32) To HKXPR06MB165.apcprd06.prod.outlook.com (10.242.124.16) Authentication-Results: intel.com; dkim=none (message not signed) header.d=none; intel.com; dmarc=none action=none header.from=renesas.com; X-DmarcAction-Test: None X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(3005004);SRVR:HKXPR06MB165; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004); SRVR:HKXPR06MB165; X-Forefront-PRVS: 0471B73328 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(50466002)(19580405001)(87976001)(19580395003)(229853001)(33646002)(83506001)(46102003)(77156002)(66066001)(62966003)(50986999)(2950100001)(77096005)(46406003)(76176999)(53416004)(54356999)(122386002)(36756003)(23726002)(92566002)(47776003)(40100003)(86362001)(42186005); 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-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jan 2015 01:04:09.1161 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HKXPR06MB165 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@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 --- v3 -> v4 - 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 c4eb234..d59c9f8 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; @@ -1377,9 +1378,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) { @@ -1949,6 +1956,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); @@ -1961,6 +1969,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);