From patchwork Tue Mar 10 01:25:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 5973371 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 26B0C9F2A9 for ; Tue, 10 Mar 2015 01:25:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5AC832041B for ; Tue, 10 Mar 2015 01:25:20 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 1E62020414 for ; Tue, 10 Mar 2015 01:25:19 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 43FE72614C7; Tue, 10 Mar 2015 02:25:18 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id D4C642614CA; Tue, 10 Mar 2015 02:25:14 +0100 (CET) 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 160962614CA; Tue, 10 Mar 2015 02:25:13 +0100 (CET) Received: from relmlie2.idc.renesas.com (relmlor3.renesas.com [210.160.252.173]) by alsa0.perex.cz (Postfix) with ESMTP id 68CE02614C2 for ; Tue, 10 Mar 2015 02:25:05 +0100 (CET) Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie2.idc.renesas.com with ESMTP; 10 Mar 2015 10:25:03 +0900 Received: from relmlac4.idc.renesas.com (relmlac4.idc.renesas.com [10.200.69.24]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id E43AB47255; Tue, 10 Mar 2015 10:25:03 +0900 (JST) Received: by relmlac4.idc.renesas.com (Postfix, from userid 0) id D8B23480A3; Tue, 10 Mar 2015 10:25:03 +0900 (JST) Received: from relmlac4.idc.renesas.com (localhost [127.0.0.1]) by relmlac4.idc.renesas.com (Postfix) with ESMTP id D36A548014; Tue, 10 Mar 2015 10:25:03 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac4.idc.renesas.com with ESMTP id LAF09149; Tue, 10 Mar 2015 10:25:03 +0900 X-IronPort-AV: E=Sophos;i="5.11,371,1422889200"; d="scan'208";a="181539002" Received: from mail-sg1lp0093.outbound.protection.outlook.com (HELO APAC01-SG1-obe.outbound.protection.outlook.com) ([207.46.51.93]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 10 Mar 2015 10:25:03 +0900 Received: from morimoto-PC.renesas.com (211.11.155.132) by SIXPR06MB320.apcprd06.prod.outlook.com (10.141.125.150) with Microsoft SMTP Server (TLS) id 15.1.106.15; Tue, 10 Mar 2015 01:25:01 +0000 Message-ID: <871tkxtzj8.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 To: Mark Brown In-Reply-To: <87385dtzla.wl%kuninori.morimoto.gx@renesas.com> References: <87385dtzla.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Tue, 10 Mar 2015 01:25:01 +0000 X-Originating-IP: [211.11.155.132] X-ClientProxiedBy: TY1PR01CA0020.jpnprd01.prod.outlook.com (25.161.131.158) To SIXPR06MB320.apcprd06.prod.outlook.com (10.141.125.150) Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SIXPR06MB320; X-Microsoft-Antispam-PRVS: X-Forefront-Antispam-Report: BMV:1; SFV:NSPM; SFS:(10019020)(979002)(6009001)(92566002)(50466002)(77096005)(77156002)(229853001)(19580395003)(86362001)(19580405001)(50986999)(62966003)(68736005)(36756003)(87976001)(46406003)(76176999)(23726002)(110136001)(54356999)(2950100001)(53416004)(46102003)(122386002)(83506001)(66066001)(40100003)(42186005)(97736003)(47776003)(33646002)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1102; SCL:1; SRVR:SIXPR06MB320; H:morimoto-PC.renesas.com; FPR:; SPF:None; MLV:ovrnspm; PTR:InfoNoRecords; LANG:en; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(5002009); SRVR:SIXPR06MB320; BCL:0; PCL:0; RULEID:; SRVR:SIXPR06MB320; X-Forefront-PRVS: 051158ECBB X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Mar 2015 01:25:01.4981 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SIXPR06MB320 Cc: Linux-ALSA , Simon , Liam Girdwood Subject: [alsa-devel] [PATCH 1/2] ASoC: rsnd: recover PIO mode for new dma interface 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 Renesas sound driver needs 1st/2nd DMA interface, and 1st DMA is using DMAEngine, and 2nd is using local method now. 2nd DMA had been DMAEngine, but it was moved to local method by previous patchset. But then, it lost PIO mode fallback when probe. this patch recovers it. Signed-off-by: Kuninori Morimoto --- sound/soc/sh/rcar/dma.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/sound/soc/sh/rcar/dma.c b/sound/soc/sh/rcar/dma.c index 92fd550..d6509b7 100644 --- a/sound/soc/sh/rcar/dma.c +++ b/sound/soc/sh/rcar/dma.c @@ -539,6 +539,13 @@ void rsnd_dma_start(struct rsnd_dma *dma) void rsnd_dma_quit(struct rsnd_dma *dma) { + struct rsnd_mod *mod = rsnd_dma_to_mod(dma); + struct rsnd_priv *priv = rsnd_mod_to_priv(mod); + struct rsnd_dma_ctrl *dmac = rsnd_priv_to_dmac(priv); + + if (!dmac) + return; + dma->ops->quit(dma); } @@ -548,8 +555,18 @@ int rsnd_dma_init(struct rsnd_priv *priv, struct rsnd_dma *dma, int id) struct rsnd_mod *mod_from; struct rsnd_mod *mod_to; struct rsnd_dai_stream *io = rsnd_mod_to_io(mod); + struct rsnd_dma_ctrl *dmac = rsnd_priv_to_dmac(priv); int is_play = rsnd_io_is_play(io); + /* + * DMA failed. try to PIO mode + * see + * rsnd_ssi_fallback() + * rsnd_rdai_continuance_probe() + */ + if (!dmac) + return -EAGAIN; + rsnd_dma_of_path(dma, is_play, &mod_from, &mod_to); dma->src_addr = rsnd_dma_addr(priv, mod_from, is_play, 1); @@ -589,7 +606,7 @@ int rsnd_dma_probe(struct platform_device *pdev, dmac = devm_kzalloc(dev, sizeof(*dmac), GFP_KERNEL); if (!dmac || !res) { dev_err(dev, "dma allocate failed\n"); - return -ENOMEM; + return 0; /* it will be PIO mode */ } dmac->dmapp_num = 0;