From patchwork Mon Jun 15 06:25:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 6606401 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 54EEEC0020 for ; Mon, 15 Jun 2015 06:33:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 64709201ED for ; Mon, 15 Jun 2015 06:33:08 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 15EFE201C0 for ; Mon, 15 Jun 2015 06:33:07 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 1A15A2614D0; Mon, 15 Jun 2015 08:33:06 +0200 (CEST) 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, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 1083C2608B1; Mon, 15 Jun 2015 08:28:39 +0200 (CEST) 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 61E9E261785; Mon, 15 Jun 2015 08:28:38 +0200 (CEST) Received: from relmlie3.idc.renesas.com (relmlor4.renesas.com [210.160.252.174]) by alsa0.perex.cz (Postfix) with ESMTP id 256B02608B1 for ; Mon, 15 Jun 2015 08:25:52 +0200 (CEST) Received: from unknown (HELO relmlir4.idc.renesas.com) ([10.200.68.154]) by relmlie3.idc.renesas.com with ESMTP; 15 Jun 2015 15:25:51 +0900 Received: from relmlac3.idc.renesas.com (relmlac3.idc.renesas.com [10.200.69.23]) by relmlir4.idc.renesas.com (Postfix) with ESMTP id B2F3E465BD; Mon, 15 Jun 2015 15:25:51 +0900 (JST) Received: by relmlac3.idc.renesas.com (Postfix, from userid 0) id A6A411806F; Mon, 15 Jun 2015 15:25:51 +0900 (JST) Received: from relmlac3.idc.renesas.com (localhost [127.0.0.1]) by relmlac3.idc.renesas.com (Postfix) with ESMTP id 62FEF1800A; Mon, 15 Jun 2015 15:25:51 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac3.idc.renesas.com with ESMTP id RAA18876; Mon, 15 Jun 2015 15:25:51 +0900 X-IronPort-AV: E=Sophos;i="5.13,616,1427727600"; d="scan'";a="189472592" Received: from mail-hk1lp0125.outbound.protection.outlook.com (HELO APAC01-HK1-obe.outbound.protection.outlook.com) ([207.46.51.125]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 15 Jun 2015 15:25:50 +0900 Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; Received: from morimoto-PC.renesas.com (211.11.155.132) by SINPR06MB315.apcprd06.prod.outlook.com (10.141.115.153) with Microsoft SMTP Server (TLS) id 15.1.190.14; Mon, 15 Jun 2015 06:25:48 +0000 Message-ID: <87a8w1v6an.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: <87twu9v6kn.wl%kuninori.morimoto.gx@renesas.com> References: <87twu9v6kn.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Mon, 15 Jun 2015 06:25:48 +0000 X-Originating-IP: [211.11.155.132] X-ClientProxiedBy: TY1PR01CA0023.jpnprd01.prod.outlook.com (25.161.131.161) To SINPR06MB315.apcprd06.prod.outlook.com (10.141.115.153) X-Microsoft-Exchange-Diagnostics: 1; SINPR06MB315; 2:aRKsHOuyi78F4gk5OWrVVPaeg++HWNn1Nf7TKMWwM1A/zsTWVDDQNtBHbnP+EXxb; 2:qxA5pCIXbkaHs7h7fqM/lZKujzdw8xy1LY/SBFxYj6DhDa4WT7rK9YArE0n3DEC0o4VLDOX8CiaaNbR5+I6IPGde7i2hraxUigHcm+5ZZ01Lo87SDNIlv6oG9Y6IzyA4Rl0ATyZ/3WQDvZYLVMDO8g==; 6:4dskVcOuW9PNXmHxOhVscAbQVImbtfpiRpQ0zCsHszljz94cQeMBwsrq0s6NGj4FNuuTEIFkupqXrFO6VP7aL+3U33ozFidcN0aJlIhYxSYFNJOc5deVUFLhzWD0UZH3RpZzgFVDHf6UZ0wn57l5LeEMEdg+7pYnbCcpn9qdu1SOl008nEWS5Dvw/PcUk/5uuNWx5MV8J9TW5ck1RMSXuTK+Z7LjyITob1M2AND4ulspU5tSfG7n5vqYGWY6DamUxONxsiGnVe2+254iIS59MCTQEhZW/47+vG6cBYABO5HxtRW/i8K19nVoaQ87cEV4dTWEwxwG9kVNBZ73agOyyBWiiQxKiuwT84j+mj3O6PY/s2hFSJCxb1SLg88F+Bo1Wtxm8Dfm9X/LK9/hnXOzjm2GmH5GnUcJ22/pShFCKoEPtoRpXqzLCEYraPpQ85n8VVb8uf7okmLBzLNxOQnZpffvvemVla5p73CQDzT9nvwbpS9RL1MOoPOsZ5IY253x X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SINPR06MB315; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(520003)(5005006)(3002001); SRVR:SINPR06MB315; BCL:0; PCL:0; RULEID:; SRVR:SINPR06MB315; X-Microsoft-Exchange-Diagnostics: 1; SINPR06MB315; 3:jRv/rg040pIGPAjuqHD36FBEHlU4CRpsk8O0sF1vIsgYb94326FdBxFXN80SiXi7B3rETw3UGrmYOvPlBTMjwbOnZfK+/fRfOhhj8RwaUWvv7AaEuRsbBr5fIB904T2w5HBJPHmuMmr4SI5n9pUDeZCAO5TXn2CwaZFecTyUXZaSIrTh0mW8UZ6ExeEzYdNz5CyH8MRBuoEsHOdJOoaCUOhS3cfNRu9DT9wywJmgtxrBniFsmcF1LLFRR7CgobNsK6FTsQeiVkz/iMrP+SVd6XOtnhTBmBq8D66Y6gtNLrxRFOLytH9MHWXmltymiumn X-Forefront-PRVS: 0608DEDB67 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(189998001)(77096005)(62966003)(50466002)(77156002)(2950100001)(42186005)(83506001)(86362001)(53416004)(4001350100001)(40100003)(122386002)(87976001)(5001960100002)(110136002)(33646002)(66066001)(36756003)(46102003)(5001920100001)(19580395003)(19580405001)(92566002)(50986999)(76176999)(54356999)(47776003)(23726002)(229853001); DIR:OUT; SFP:1102; SCL:1; SRVR:SINPR06MB315; H:morimoto-PC.renesas.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; SINPR06MB315; 9:2FxQTb306BgtWtLZM3PjTUuiyC5/KOzQuLnr8qfz5UuWYHIJFCIEiQd3DwcZXAKw+osIh7vh7FwvQSHk6OC1g2Aj2XHNjBXkJwGdQLOHB9bvYB6eSCGQfXq+yD0Ns5cLFpiW2VgPHDdxhJtX7fUCMQL/g1ykDXrpjQTLREPYDbhSWgpmxM6JyP6KYmkoRbLLy6gfTgMEFrkV1YNdJw4Fl2/Y+0cpkC+klj374HlMCb5ohrvZPARqv00fszX4XZg1B7+EV5TFD1Qu+1BEPGHDbwG15Z8UoUUMMwoLWPcbeC7JQGGapIE3B+jFjEi7lnJGRk5JoqMbO9ukPy6a7pPLMs8puPQwZMnGf9rkJpQWXzu31By52AubqiTJ7z+OX5efIrvbKkVYl9RxTbQGwk5/Rtj69t8SS6KJ82FOaHmz9O+R/QS/uqAmr8RUk3S/+jQfASwd9Yy0lG1tVqUaSZ2fKuI/73yO23R02vgOf31H7/GhRj70XYPKwYg+gfsc3wf1BMjr5i+mdHBxSUJL6Wnvb/QVfKl9D5hdxRp8UKZA5pZKhIzedHrbmbS45yIxIuGI11C8oY7mvSKweRi2uV06wfMS5QxPJf9CkW+aNOMj89WT1Qc5xfm/SEoBVMd9ous+5/CaBH22KThWonRiAdLRht5vr3OWZkBtzu85H/n2+V4Nstu0KeZwD/uGesLcEndmVixc7dAdJ4F+pMb0FJAuDX57xRGh+O5CIUN+DtE9MohybbI/uLRqQeYr2acq0CNLoL3XL9yhi/CWgggts4v8mmpEQOrd3LLEv0BUaDr/SOkud/MM2UWdk8EiqK786IjyrehCPC46heI/tHcb/nPZtEawzWyiv9Nbu0oePGNl6p0= X-Microsoft-Exchange-Diagnostics: 1; SINPR06MB315; 3:y6XTR7+lmSXfWlmVA2Qes9KuxQ8EpRf+rAJH3Of78qi3rXEBn8EcKKJseRcuNelqLVM0xjj9m1V7XjP/iUujxDPEfPd5gpJ4Gh/I9QNELIX1j7sw/LJ2BGrRwZFNrZCMLAR7Gsqh6y3PWeFTtAERMg==; 10:4L6CMtKOkDWksfnMaxoiaeygcsn05CeE1AEa0i9or804/jgp+a6im09mHJhLpAEf+d6KgwE3AAf+EWjeTXuumdYHlJQ2mmX98aQZI/F71v0=; 6:sNKs/e5ZQq4hGjdorJn547rprdAD3wSz06dbRUTR/q7t3oPtCmA4gZcdozmfzZmjoUEPqFMWaFhv+z6FC2cJx48d1tMd64H5maLeU6dy2WckpJeEyxjZo3UGKIa4nihCNc6dRss5ZvOXkOf8Lsf4cg== X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jun 2015 06:25:48.9256 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SINPR06MB315 Cc: Linux-ALSA , Simon , Liam Girdwood Subject: [alsa-devel] [PATCH 14/21] ASoC: rsnd: add common interrupt handler for SSI/SRC/DMA 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 Each Renesas sound mod (= SSI/SRC/DVC) might be called from many paths if it supports MIXer. In such case, mod <-> io is no longer 1:1 relationship. Then, interrupt handler can't use rsnd_mod_to_io(). This patch adds SSI/SRC/DMA common interrupt handler frame Signed-off-by: Kuninori Morimoto Tested-by: Keita Kobayashi --- sound/soc/sh/rcar/core.c | 23 +++++++++++++++++++++++ sound/soc/sh/rcar/rsnd.h | 3 +++ 2 files changed, 26 insertions(+) diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c index 54297d7..424d1a3 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c @@ -172,6 +172,29 @@ void rsnd_mod_quit(struct rsnd_mod *mod) clk_unprepare(mod->clk); } +void rsnd_mod_interrupt(struct rsnd_mod *mod, + void (*callback)(struct rsnd_mod *mod, + struct rsnd_dai_stream *io)) +{ + struct rsnd_priv *priv = rsnd_mod_to_priv(mod); + struct rsnd_dai_stream *io; + struct rsnd_dai *rdai; + int i, j; + + for_each_rsnd_dai(rdai, priv, j) { + + for (i = 0; i < RSND_MOD_MAX; i++) { + io = &rdai->playback; + if (mod == io->mod[i]) + callback(mod, io); + + io = &rdai->capture; + if (mod == io->mod[i]) + callback(mod, io); + } + } +} + int rsnd_mod_is_working(struct rsnd_mod *mod) { struct rsnd_dai_stream *io = rsnd_mod_to_io(mod); diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h index fd93a6a..e6aad5e 100644 --- a/sound/soc/sh/rcar/rsnd.h +++ b/sound/soc/sh/rcar/rsnd.h @@ -327,6 +327,9 @@ void rsnd_mod_quit(struct rsnd_mod *mod); char *rsnd_mod_name(struct rsnd_mod *mod); int rsnd_mod_is_working(struct rsnd_mod *mod); struct dma_chan *rsnd_mod_dma_req(struct rsnd_mod *mod); +void rsnd_mod_interrupt(struct rsnd_mod *mod, + void (*callback)(struct rsnd_mod *mod, + struct rsnd_dai_stream *io)); /* * R-Car sound DAI