From patchwork Mon Jun 15 06:24:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 6606381 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 8754A9F399 for ; Mon, 15 Jun 2015 06:31:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9960E2053F for ; Mon, 15 Jun 2015 06:31:14 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id E494B2052C for ; Mon, 15 Jun 2015 06:31:12 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 13099265019; Mon, 15 Jun 2015 08:31:12 +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 987D82610A7; Mon, 15 Jun 2015 08:27:35 +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 1C9C92608F0; Mon, 15 Jun 2015 08:27:34 +0200 (CEST) Received: from relmlie3.idc.renesas.com (relmlor4.renesas.com [210.160.252.174]) by alsa0.perex.cz (Postfix) with ESMTP id E010B2610A7 for ; Mon, 15 Jun 2015 08:24:59 +0200 (CEST) Received: from unknown (HELO relmlir2.idc.renesas.com) ([10.200.68.152]) by relmlie3.idc.renesas.com with ESMTP; 15 Jun 2015 15:24:58 +0900 Received: from relmlac3.idc.renesas.com (relmlac3.idc.renesas.com [10.200.69.23]) by relmlir2.idc.renesas.com (Postfix) with ESMTP id 882D4453D5; Mon, 15 Jun 2015 15:24:58 +0900 (JST) Received: by relmlac3.idc.renesas.com (Postfix, from userid 0) id 7EB9A1806F; Mon, 15 Jun 2015 15:24:58 +0900 (JST) Received: from relmlac3.idc.renesas.com (localhost [127.0.0.1]) by relmlac3.idc.renesas.com (Postfix) with ESMTP id 766DD1800A; Mon, 15 Jun 2015 15:24:58 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac3.idc.renesas.com with ESMTP id RAA18398; Mon, 15 Jun 2015 15:24:58 +0900 X-IronPort-AV: E=Sophos;i="5.13,616,1427727600"; d="scan'";a="189472520" Received: from mail-hk1lp0119.outbound.protection.outlook.com (HELO APAC01-HK1-obe.outbound.protection.outlook.com) ([207.46.51.119]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 15 Jun 2015 15:24:57 +0900 Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; Received: from morimoto-PC.renesas.com (211.11.155.132) by SIXPR06MB318.apcprd06.prod.outlook.com (10.141.125.144) with Microsoft SMTP Server (TLS) id 15.1.190.14; Mon, 15 Jun 2015 06:24:54 +0000 Message-ID: <87d20xv6c6.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:24:54 +0000 X-Originating-IP: [211.11.155.132] X-ClientProxiedBy: OS2PR01CA0004.jpnprd01.prod.outlook.com (25.161.74.142) To SIXPR06MB318.apcprd06.prod.outlook.com (10.141.125.144) X-Microsoft-Exchange-Diagnostics: 1; SIXPR06MB318; 2:NaPzi/Lvzz4xJkJID1Ol9kH7wRpnT97XeNjUyLjJigeoDt5HAQu9M9W33bcsS8lR; 2:RCqzLFKnuwBFIReOytdzr1+PJpImSgYOV1R3XAGwggCDylLQVdR6jlGnMqA7xB1iB1Yva5E3CRfh5TEUO0vxoIGj4HMdkRpzJbdf2YU0i6W89wmCzexS0JmUCAAEJI0UwE5othiWkLIYV8y7LV7EVg==; 6:LL/klvGgv4hIdM2fp3SODGl8qc9qqwRiVaFOBBc92TB1pWD3Ju5sCIX51qrM1rd45ocWTIdySmEUn22cCoLQ25TUn9Qgzulimawqo6EwlyFSJ+3W3R8/3FECGRtnMAe4rBIKIHnv4jr11Y+3lTHNCrWJUDlwg2b5VX7K+bzaYqOISOryjNc9Q4Ld2/9E+ziUGLr+hbcgwGaVpODHO1NcQK9J5zwPpS+/KNKnuzQTQZm7Yd/eJy5eQy6KEQ6P+ZQEwPlYOMq1u4nh4tF4XcQY2nXdsQqxfAeWpm97M/RJbvJ3D4g6YfxIxuCExFlXg1sju7d0gvM9jH2QFnLN8EV76f3ZAjrlLrNoP9DIUkxf/VlOV68jCg/9RVZEe84gV+2Apx8PBvck4mJnhIsA00rSsDjfEEx2rvidg7KIofd9GiJ/OCwk/nZ8ZoO7YM2ebOUsDyaZS8rBMiRmjAk/KWKjbMQjM4Pesm6MsoSom8HvWkg4YUNpj3DzGr+QRqbhHORY X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SIXPR06MB318; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(520003)(3002001); SRVR:SIXPR06MB318; BCL:0; PCL:0; RULEID:; SRVR:SIXPR06MB318; X-Microsoft-Exchange-Diagnostics: 1; SIXPR06MB318; 3:JuD05cPFCkkfXojXhWRLV2vk3fY+QhHndV81gMbfsSc9dyAUk+sr8usoTxX6QBw4xe3X5/Yh4EbrR6Njp+ErrjmzH8ZILe33BNbpkWKGh9J8d9/68B0pf1RRjtmeOYRd2K9BMEuNIzTZjScmO6YPJAtNZkmAsIbpPr9/5s2kBr7+Z6KGREYNqHVx0FaC0kO9oA99iVIwiaAjHg+TnSI10yVhfHDk0+pNWS/mGYIQIvIwbS7ntb5Uel78zcR4GIWqGQa8fyAVjKZAOdYDL60GS7tPd/r/cOfB6QCQb2XKGQuiaXvzp5RU0nAdoaoKOMeU X-Forefront-PRVS: 0608DEDB67 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(46406003)(83506001)(77156002)(189998001)(5001920100001)(62966003)(40100003)(122386002)(110136002)(5001960100002)(50466002)(53416004)(46102003)(19580405001)(42186005)(87976001)(54356999)(66066001)(2950100001)(76176999)(50986999)(4001350100001)(36756003)(23726002)(77096005)(229853001)(33646002)(86362001)(19580395003)(92566002)(47776003); DIR:OUT; SFP:1102; SCL:1; SRVR:SIXPR06MB318; H:morimoto-PC.renesas.com; FPR:; SPF:None; MLV:sfv; LANG:; X-Microsoft-Exchange-Diagnostics: 1; SIXPR06MB318; 9:oed6RyvZQEYYqDEt5kWEgs7WlIew4ayUtW73o7v6h2RWgHAmOZNy2Lhp7q86PeyBPw9vM5t6P+gWdW69qGXG7lQO4jojH5H0OOEGas8WSnWlFy9ezPvS/rMJuLzV9XWBeeeg7RPUzut9m4LK3NK2kKqTTG9y0TtmGxnElBj085j8zAymHntT3QD4Po0W77nENikRHptkn//w6rH59/ir9e1zVZFPS60IEW2PO+EnEJPiLnQ5tGHd4D3SxSVFgPxKX+5tLgOnoQKOaoAjnJRrNdFsEJ28aXxyutLSQVWu9Yruhp7arnhHb2c5Yx1O1gyYMAg/QLZqYXfgpzMgJu6UpMaQTIA8suWuYwGvUfb5zUBuLfpUOIuMU0iOKt5Rvkvwsh1Q4XV+MbgGIxOx/gyh7YIEIcclp7y8VoaE1InKBE7WJ2OzwVwvmTJWh77J8CGIcEX+kB8dl2xK9zYPn+lwv38+YVpe5AKYgFvNQlIYMDDSRHxZ5halLnhfdWNUu37RmTFFE1ic54NxxZ6W6i3+KyCJzmSMJwnmbTSlJgIOf5Toxn9pAo/aM6UY/SPORbl1eZaTdUXewG926mkor8dkmDKXi8/ziczW/OP3XyUARFv9kKsbpntRt4ORDCEsrlFp30OVBa6srm8/s76Mgxz92vN2CHyMrk9xXT1kGNKeNy3bZDNZ0yLVIHi4UVQHLlFSxyuQ7m6y1mRMWYlx99HRAEV/BpAGzL4heLSEfYLUIEozESylvrloE2kb8ZXDEvMb/YPStyYGXzBl0+S3zwH0taL4JTAJZ5ZPuBngtaxsoU28iJD+y8n3Nso5qLFQucORd5TAs2kRI9+KzLFIt6gOGhnQvVneci/wD9zLzh1a4bHPAN5UKb2JEHOgmC5e6J4l X-Microsoft-Exchange-Diagnostics: 1; SIXPR06MB318; 3:2z8nQTqUVyODUma6nx0XRggoPxe3dmJyOKEsb3BxMJoS2B+ql45vvPk0sNVow9L3mBxc7CrWrY3ihMX8lX7V7qQFgU0fxdNTP/QChZRjnD6klqaKHEdunvga4UfBuWhd2D1TQ3rGa81Jd+upfOk1Rg==; 10:w6vo4ILme2mIg7wENV3tSgN7FDfwqZzKb5JrMrDGNeZX2jGP93sT1bFfes6Prrviw8GwpZwBF2HC1a1dx4w0LvM3dDeAEQDqtUlIWBe8SzY=; 6:klwUQJhKwdUYdMC/nCdwhoWoRSrf+DXQH5+PYJUKNTNXRQANgdc2WD5iAGMtxsltYHZlk/3Ca1z727+IiAAwPvSzbQHYZKGdNRQR9aBm/LBYp3W341jdRk35gkhvVpibbR+0pcLhdhW4h2sdv5iAgQ== X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jun 2015 06:24:54.3363 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SIXPR06MB318 Cc: Linux-ALSA , Simon , Liam Girdwood Subject: [alsa-devel] [PATCH 12/21] ASoC: rsnd: rsnd_mod has rsnd_priv 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. This means we can't use rsnd_mod_to_io() in SSI/SRC/DMA interrupt handler. In such case, we need to check all io in interrupt handler, and then, "priv" is needed. This patch adds rsnd_priv pointer in rsnd_mod for prepare it. Signed-off-by: Kuninori Morimoto Tested-by: Keita Kobayashi --- sound/soc/sh/rcar/core.c | 4 +++- sound/soc/sh/rcar/dvc.c | 2 +- sound/soc/sh/rcar/rsnd.h | 6 ++++-- sound/soc/sh/rcar/src.c | 2 +- sound/soc/sh/rcar/ssi.c | 2 +- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c index 50ec28c..1e8d7e5 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c @@ -145,7 +145,8 @@ struct dma_chan *rsnd_mod_dma_req(struct rsnd_mod *mod) return mod->ops->dma_req(mod); } -int rsnd_mod_init(struct rsnd_mod *mod, +int rsnd_mod_init(struct rsnd_priv *priv, + struct rsnd_mod *mod, struct rsnd_mod_ops *ops, struct clk *clk, enum rsnd_mod_type type, @@ -160,6 +161,7 @@ int rsnd_mod_init(struct rsnd_mod *mod, mod->ops = ops; mod->type = type; mod->clk = clk; + mod->priv = priv; return ret; } diff --git a/sound/soc/sh/rcar/dvc.c b/sound/soc/sh/rcar/dvc.c index e5fcb06..2004bd0 100644 --- a/sound/soc/sh/rcar/dvc.c +++ b/sound/soc/sh/rcar/dvc.c @@ -366,7 +366,7 @@ int rsnd_dvc_probe(struct platform_device *pdev, dvc->info = &info->dvc_info[i]; - ret = rsnd_mod_init(&dvc->mod, &rsnd_dvc_ops, + ret = rsnd_mod_init(priv, &dvc->mod, &rsnd_dvc_ops, clk, RSND_MOD_DVC, i); if (ret) return ret; diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h index 8a114cb..4561b97 100644 --- a/sound/soc/sh/rcar/rsnd.h +++ b/sound/soc/sh/rcar/rsnd.h @@ -253,6 +253,7 @@ struct rsnd_mod { struct rsnd_mod_ops *ops; struct rsnd_dma dma; struct rsnd_dai_stream *io; + struct rsnd_priv *priv; struct clk *clk; u32 status; }; @@ -300,14 +301,15 @@ struct rsnd_mod { #define __rsnd_mod_call_fallback 0 #define __rsnd_mod_call_hw_params 0 -#define rsnd_mod_to_priv(mod) (rsnd_io_to_priv(rsnd_mod_to_io(mod))) +#define rsnd_mod_to_priv(mod) ((mod)->priv) #define rsnd_mod_to_dma(mod) (&(mod)->dma) #define rsnd_mod_to_io(mod) ((mod)->io) #define rsnd_mod_id(mod) ((mod)->id) #define rsnd_mod_hw_start(mod) clk_enable((mod)->clk) #define rsnd_mod_hw_stop(mod) clk_disable((mod)->clk) -int rsnd_mod_init(struct rsnd_mod *mod, +int rsnd_mod_init(struct rsnd_priv *priv, + struct rsnd_mod *mod, struct rsnd_mod_ops *ops, struct clk *clk, enum rsnd_mod_type type, diff --git a/sound/soc/sh/rcar/src.c b/sound/soc/sh/rcar/src.c index fbe9166..316d139 100644 --- a/sound/soc/sh/rcar/src.c +++ b/sound/soc/sh/rcar/src.c @@ -1046,7 +1046,7 @@ int rsnd_src_probe(struct platform_device *pdev, src->info = &info->src_info[i]; - ret = rsnd_mod_init(&src->mod, ops, clk, RSND_MOD_SRC, i); + ret = rsnd_mod_init(priv, &src->mod, ops, clk, RSND_MOD_SRC, i); if (ret) return ret; } diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c index 2548321..16ced76 100644 --- a/sound/soc/sh/rcar/ssi.c +++ b/sound/soc/sh/rcar/ssi.c @@ -782,7 +782,7 @@ int rsnd_ssi_probe(struct platform_device *pdev, else if (rsnd_ssi_pio_available(ssi)) ops = &rsnd_ssi_pio_ops; - ret = rsnd_mod_init(&ssi->mod, ops, clk, RSND_MOD_SSI, i); + ret = rsnd_mod_init(priv, &ssi->mod, ops, clk, RSND_MOD_SSI, i); if (ret) return ret;