From patchwork Thu Nov 27 08:02: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: 5392931 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 B926D9F39B for ; Thu, 27 Nov 2014 08:03:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D87D4201ED for ; Thu, 27 Nov 2014 08:03:32 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id A8674201C8 for ; Thu, 27 Nov 2014 08:03:31 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 461DD265A9D; Thu, 27 Nov 2014 09:03:28 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id A69B32659E8; Thu, 27 Nov 2014 09:03:13 +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 A1B7D2659E8; Thu, 27 Nov 2014 09:03:12 +0100 (CET) Received: from relmlie1.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by alsa0.perex.cz (Postfix) with ESMTP id F045A265960 for ; Thu, 27 Nov 2014 09:02:46 +0100 (CET) Received: from unknown (HELO relmlir4.idc.renesas.com) ([10.200.68.154]) by relmlie1.idc.renesas.com with ESMTP; 27 Nov 2014 17:02:45 +0900 Received: from relmlac1.idc.renesas.com (relmlac1.idc.renesas.com [10.200.69.21]) by relmlir4.idc.renesas.com (Postfix) with ESMTP id 939FB4A050; Thu, 27 Nov 2014 17:02:45 +0900 (JST) Received: by relmlac1.idc.renesas.com (Postfix, from userid 0) id 88D078002E; Thu, 27 Nov 2014 17:02:45 +0900 (JST) Received: from relmlac1.idc.renesas.com (localhost [127.0.0.1]) by relmlac1.idc.renesas.com (Postfix) with ESMTP id 8104B8002D; Thu, 27 Nov 2014 17:02:45 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac1.idc.renesas.com with ESMTP id TAJ29769; Thu, 27 Nov 2014 17:02:45 +0900 X-IronPort-AV: E=Sophos;i="5.07,467,1413212400"; d="scan'208";a="175655070" Received: from mail-sg1lp0091.outbound.protection.outlook.com (HELO APAC01-SG1-obe.outbound.protection.outlook.com) ([207.46.51.91]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 27 Nov 2014 17:02:44 +0900 Received: from remon.renesas.com (211.11.155.132) by HKNPR06MB162.apcprd06.prod.outlook.com (10.242.104.19) with Microsoft SMTP Server (TLS) id 15.1.26.15; Thu, 27 Nov 2014 08:02:43 +0000 Message-ID: <8761e19iky.wl%kuninori.morimoto.gx@renesas.com> To: Mark Brown In-Reply-To: <877fyh9ilx.wl%kuninori.morimoto.gx@renesas.com> References: <877fyh9ilx.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.14.0 Emacs/23.3 Mule/6.0 MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Date: Thu, 27 Nov 2014 08:02:43 +0000 X-Originating-IP: [211.11.155.132] X-ClientProxiedBy: HK2PR01CA0021.apcprd01.prod.exchangelabs.com (25.160.175.31) To HKNPR06MB162.apcprd06.prod.outlook.com (10.242.104.19) X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:HKNPR06MB162; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:;SRVR:HKNPR06MB162; X-Forefront-PRVS: 040866B734 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(199003)(46034005)(189002)(107046002)(229853001)(77096003)(77156002)(101416001)(110136001)(50466002)(46102003)(21056001)(81156004)(4396001)(62966003)(106356001)(92566001)(92726001)(86362001)(46406003)(64706001)(102836001)(105586002)(42186005)(66066001)(40100003)(53416004)(47776003)(99396003)(31966008)(19580405001)(97736003)(19580395003)(76176999)(54356999)(95666004)(69596002)(20776003)(50986999)(23726002)(120916001)(83506001)(36756003)(33646002)(122386002)(142923001); DIR:OUT; SFP:1102; SCL:1; SRVR:HKNPR06MB162; H:remon.renesas.com; FPR:; SPF:None; MLV:sfv; PTR:InfoNoRecords; A:1; MX:1; LANG:en; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:;SRVR:HKNPR06MB162; X-OriginatorOrg: renesas.com Cc: Linux-ALSA , Simon , Liam Girdwood Subject: [alsa-devel] [PATCH 01/20] ASoC: rsnd: add .fallback callback 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 Current R-Car sound has PIO fallback support if it couldn't use DMA. This fallback is done in .remove callback, but, it should have .fallback callback. Otherwise, normal .remove callback will have strange behavior. This patch adds .fallback callback. Signed-off-by: Kuninori Morimoto --- sound/soc/sh/rcar/core.c | 9 +++++++-- sound/soc/sh/rcar/rsnd.h | 2 ++ sound/soc/sh/rcar/ssi.c | 11 +++++++++-- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c index 110b99d..0785f84 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c @@ -368,7 +368,7 @@ rsnd_dma_channel_err: /* * DMA failed. try to PIO mode * see - * rsnd_ssi_dma_remove() + * rsnd_ssi_fallback() * rsnd_rdai_continuance_probe() */ return -EAGAIN; @@ -1023,7 +1023,7 @@ static int rsnd_rdai_continuance_probe(struct rsnd_priv *priv, * SSI will be switch to PIO mode if it was DMA mode * see * rsnd_dma_init() - * rsnd_ssi_dma_remove() + * rsnd_ssi_fallback() */ rsnd_dai_call(remove, io, rdai); @@ -1034,6 +1034,11 @@ static int rsnd_rdai_continuance_probe(struct rsnd_priv *priv, rsnd_path_break(priv, io, dvc); /* + * fallback + */ + rsnd_dai_call(fallback, io, rdai); + + /* * retry to "probe". * DAI has SSI which is PIO mode only now. */ diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h index ed44ca8..83e1066 100644 --- a/sound/soc/sh/rcar/rsnd.h +++ b/sound/soc/sh/rcar/rsnd.h @@ -206,6 +206,8 @@ struct rsnd_mod_ops { int (*pcm_new)(struct rsnd_mod *mod, struct rsnd_dai *rdai, struct snd_soc_pcm_runtime *rtd); + int (*fallback)(struct rsnd_mod *mod, + struct rsnd_dai *rdai); }; struct rsnd_dai_stream; diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c index 346d3dc..e03e70b 100644 --- a/sound/soc/sh/rcar/ssi.c +++ b/sound/soc/sh/rcar/ssi.c @@ -465,11 +465,17 @@ static int rsnd_ssi_dma_probe(struct rsnd_mod *mod, static int rsnd_ssi_dma_remove(struct rsnd_mod *mod, struct rsnd_dai *rdai) { + rsnd_dma_quit(rsnd_mod_to_priv(mod), rsnd_mod_to_dma(mod)); + + return 0; +} + +static int rsnd_ssi_fallback(struct rsnd_mod *mod, + struct rsnd_dai *rdai) +{ struct rsnd_priv *priv = rsnd_mod_to_priv(mod); struct device *dev = rsnd_priv_to_dev(priv); - rsnd_dma_quit(rsnd_mod_to_priv(mod), rsnd_mod_to_dma(mod)); - /* * fallback to PIO * @@ -541,6 +547,7 @@ static struct rsnd_mod_ops rsnd_ssi_dma_ops = { .quit = rsnd_ssi_quit, .start = rsnd_ssi_dma_start, .stop = rsnd_ssi_dma_stop, + .fallback = rsnd_ssi_fallback, }; /*