From patchwork Mon Jun 15 06:26:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 6606411 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 7BA539F399 for ; Mon, 15 Jun 2015 06:34:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 60B4120567 for ; Mon, 15 Jun 2015 06:33:59 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id E66022024C for ; Mon, 15 Jun 2015 06:33:57 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 08996261A7E; Mon, 15 Jun 2015 08:33:57 +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 183C0261ADE; Mon, 15 Jun 2015 08:29:23 +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 F3B9B261AE0; Mon, 15 Jun 2015 08:29:20 +0200 (CEST) Received: from relmlie1.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by alsa0.perex.cz (Postfix) with ESMTP id 092AF2608B3 for ; Mon, 15 Jun 2015 08:26:11 +0200 (CEST) Received: from unknown (HELO relmlir4.idc.renesas.com) ([10.200.68.154]) by relmlie1.idc.renesas.com with ESMTP; 15 Jun 2015 15:26:10 +0900 Received: from relmlac4.idc.renesas.com (relmlac4.idc.renesas.com [10.200.69.24]) by relmlir4.idc.renesas.com (Postfix) with ESMTP id 950FF465D8; Mon, 15 Jun 2015 15:26:10 +0900 (JST) Received: by relmlac4.idc.renesas.com (Postfix, from userid 0) id 823E5480A4; Mon, 15 Jun 2015 15:26:10 +0900 (JST) Received: from relmlac4.idc.renesas.com (localhost [127.0.0.1]) by relmlac4.idc.renesas.com (Postfix) with ESMTP id 784E2480A3; Mon, 15 Jun 2015 15:26:10 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac4.idc.renesas.com with ESMTP id RAX07564; Mon, 15 Jun 2015 15:26:10 +0900 X-IronPort-AV: E=Sophos;i="5.13,616,1427727600"; d="scan'";a="189472614" Received: from mail-sg1lp0086.outbound.protection.outlook.com (HELO APAC01-SG1-obe.outbound.protection.outlook.com) ([207.46.51.86]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 15 Jun 2015 15:26:09 +0900 Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; Received: from morimoto-PC.renesas.com (211.11.155.132) by HKNPR06MB308.apcprd06.prod.outlook.com (10.141.37.28) with Microsoft SMTP Server (TLS) id 15.1.190.14; Mon, 15 Jun 2015 06:26:08 +0000 Message-ID: <878ublv6a3.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:26:08 +0000 X-Originating-IP: [211.11.155.132] X-ClientProxiedBy: TY1PR0201CA0016.apcprd02.prod.outlook.com (25.164.90.154) To HKNPR06MB308.apcprd06.prod.outlook.com (10.141.37.28) X-Microsoft-Exchange-Diagnostics: 1; HKNPR06MB308; 2:y4LGi0oyXRV0a+eF1Xw4YRMYbo+Nc4L+O3vyTUcYDivzUSqbDsWcvCS0tYHaEllL; 2:zKIbmlFP6GFukUPpI4n/OjaY6AYr9gnBsU0tr7H0AjEnsK+apo1ft64FUukmxRGV1uDqUvuKLiZcyP+rpSWTHdwdF9JlHpE15Z7vubbBHJZ207coEwylJN4xgH6exhGV2vhKMpCIuI7uJTe3Z8ABSQ==; 6:CGYOSSozMAQp1lU3xwgCnv835/o5GIQQ+ouSN6oR4qbu/4h5qTu9dJCljV9iSU5ECFaegk+JteArrVz/N4Uil71UHIbVddijJ0TInQ+iWcAPX0Gv4nIlbOHooIHyloKn8gKpYeZmiTPyXizZ6Qt6GrOhE6+vSJaZgyGPe9S9m4oWmMu5F2OuH1bR1+1l2zEqa1SB8qQ/AUuRp+f8EgC9cJG59fMStX7mNJGJLmBkH3aMMEhEGDjSCmm3e6awc0uOl08BKbfaOj409kewCz8lmb0mBb6iVZyhqJgz9yDdUnajx12M/c/OOArUqYsJOId4TX81FGREy/IYZDwzEJRXoDh81mAbRw9vtN1TDCH8H/PsTBaTMhN+quENgOeIPR4f5Oea4hQ8WLgxCVQtkndZsmbByRg1pxtzM7v6BvJtgyGtrvYYqCeWMQDloT1J1ngWmadKjgKYnasUIOgSQOXSRr/GAwBHs40TA5B9L4bxwt12kTZlyk4zz1VIHke70rzQ X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HKNPR06MB308; 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:HKNPR06MB308; BCL:0; PCL:0; RULEID:; SRVR:HKNPR06MB308; X-Microsoft-Exchange-Diagnostics: 1; HKNPR06MB308; 3:ptL8RlawZYPuwhtVn0vhTiycgy8yNnaOxaKQ8EQqwy+0DsvDEQJPrkFSgpP8r5clG1R6RjyiprB6FHPkfJhLl1sc9Iu5dCgQmilSU/OpK0bgo+OydL2sFIK4oSh1PZmHIuD5Fj+is2Im4oodpAD4n/dMZvlIdFbSB1U2Tpk+FfMJyaq8H68ORjb62tjNI58AL8S/JhXlZx1WA/FiKDzRzT9hznnNNt/1qAUR3L0HA+gBE/gvK3lH1z94Cpfc+Wfzj2Ph88Ed1ZGIiSdgRSOVZsvCiqbTYqaSrHSQ4fPuX4tI7tBSQ0Sek6Ox5+kcIiRL X-Forefront-PRVS: 0608DEDB67 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(2950100001)(77096005)(77156002)(62966003)(4001350100001)(122386002)(40100003)(110136002)(86362001)(5001960100002)(36756003)(53416004)(42186005)(189998001)(229853001)(47776003)(50986999)(66066001)(76176999)(46102003)(92566002)(33646002)(46406003)(83506001)(19580405001)(19580395003)(54356999)(50466002)(23726002)(87976001); DIR:OUT; SFP:1102; SCL:1; SRVR:HKNPR06MB308; H:morimoto-PC.renesas.com; FPR:; SPF:None; MLV:sfv; LANG:; X-Microsoft-Exchange-Diagnostics: 1; HKNPR06MB308; 9:DuVt9/r1Hay7C5Hi2jKY4lvesGdwXGR6g8osNHyTfZ5J+KVc1C+/Gd4VPbu5Ur4s3Z+/IbTy1obrAGbV8EkBvEnL+qQ6YHhMABZZtoqu+jj8p9AjfaZmj+x4xoRcmD8CJf1rVxEbmwmPt87IRzgEAKwUvEJSusOxV37xUUB6PUVhNSp5E+sUzi1to6q4/fj0d70jCer6MGrXtokYGEjeY7bshC+q1ZWxsFyu1JCUX/xG+5fIOuVDYYtCNCwzt1AgpUY2HYjz4i7lRjaGjd0ADgaWGrsg+vaRhPrti8vkPAI9KwDXVEFTx7CJXblEdPExg8PsJclAuF8xJNZ5yDHvTN78BWp1WxEfjWrg5Z4TAl+riFf0eH2fgZQssj/7qhXOjYOH7M74l5+AGfYewwUfKtMY2KJRYbb0eliXxTmRXHUi+KpHGE5oV/dXiFN18vFCV51+6ahw7DygbDWUdk9KZQGMwcc+dS08Enk+HvosQte2FwMElhF5ngD8iDSW01+agH93Xh1fTRMuu9jlCbMAt3g3MNZQADAmGXc+ZWqnNmnjNWKwLekoViEohWrhD18t4TqCczm5tQeyG6MNXqBhJEm7sD4Op82FpCF0njeKhoGLirk5h9V8hxOGizbLnNnJDGtj9tdA7CRGICLsDLbmHE7pZdBKTOuvb6qdbkmJy1+w/dEFhgfVhVA3QxiMejNoVx9DPiZLT2xnvvecVbeJ2jShDMYOqXRYbACYN4k3be1yPGzwOQ4rOe+zdgCoXc3La+FdfkAsd/bgUc5zKRWJfsVH+aZwmyjXgTfkfqlQBbf4nzInoaufe9AO3xOmXSFvLjkb4jktSHFiIoH71+q39L37e82RA7Rq070t8yJYnpU= X-Microsoft-Exchange-Diagnostics: 1; HKNPR06MB308; 3:ExWabFiJ+6WpA34D+W/BHDv/5JVZpffAh/LctY0eRqvHXP02OyxPQIz1zxfx2mH6dan3jDOH1bM1pWCBSw56OV4t6H7fmG1IE2yAB+7a8BDsDUoL+EIymte2pw0/y48g6r5XKkFgZQ3ghb+rpcTxug==; 10:HMwlhGkdIuIfRlEa0wv8DywnMFmo9C7rxPpirJap6WZ6Ero5Sn5meEz/d9aBGNriXyC7VFZS68HGTtxFvnGzsVBvh9EjuRRGLF483uUoA6g=; 6:NfTMi22g6UFVEJyCxRR9giaQiInxZW/jHF9DkoNq70wJUxKlHTA5W0NaR185c74ONK0faQkoevuuKt8/ulGUMctn8JC475ga7D5pwcBT3jXFJnlCao26CAZEMsfv9t82hsOUFluBjT1YvbrnxxB7Aw== X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jun 2015 06:26:08.3044 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HKNPR06MB308 Cc: Linux-ALSA , Simon , Liam Girdwood Subject: [alsa-devel] [PATCH 15/21] ASoC: rsnd: don't use rsnd_mod_to_io() on rsnd_get_adinr() 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 patch removes rsnd_mod_to_io() from rsnd_get_adinr() and its related function Signed-off-by: Kuninori Morimoto Tested-by: Keita Kobayashi --- sound/soc/sh/rcar/core.c | 3 +-- sound/soc/sh/rcar/dvc.c | 2 +- sound/soc/sh/rcar/rsnd.h | 6 ++++-- sound/soc/sh/rcar/src.c | 28 +++++++++++++++------------- sound/soc/sh/rcar/ssi.c | 4 ++-- 5 files changed, 23 insertions(+), 20 deletions(-) diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c index 424d1a3..e1d1b22f 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c @@ -206,10 +206,9 @@ int rsnd_mod_is_working(struct rsnd_mod *mod) /* * settting function */ -u32 rsnd_get_adinr(struct rsnd_mod *mod) +u32 rsnd_get_adinr(struct rsnd_mod *mod, struct rsnd_dai_stream *io) { struct rsnd_priv *priv = rsnd_mod_to_priv(mod); - struct rsnd_dai_stream *io = rsnd_mod_to_io(mod); struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io); struct device *dev = rsnd_priv_to_dev(priv); u32 adinr = runtime->channels; diff --git a/sound/soc/sh/rcar/dvc.c b/sound/soc/sh/rcar/dvc.c index 52e75eb..691bc63 100644 --- a/sound/soc/sh/rcar/dvc.c +++ b/sound/soc/sh/rcar/dvc.c @@ -169,7 +169,7 @@ static int rsnd_dvc_init(struct rsnd_mod *dvc_mod, rsnd_mod_write(dvc_mod, DVC_DVUIR, 1); - rsnd_mod_write(dvc_mod, DVC_ADINR, rsnd_get_adinr(dvc_mod)); + rsnd_mod_write(dvc_mod, DVC_ADINR, rsnd_get_adinr(dvc_mod, io)); /* ch0/ch1 Volume */ rsnd_dvc_volume_update(dvc_mod); diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h index e6aad5e..b40435d 100644 --- a/sound/soc/sh/rcar/rsnd.h +++ b/sound/soc/sh/rcar/rsnd.h @@ -165,7 +165,7 @@ void rsnd_write(struct rsnd_priv *priv, struct rsnd_mod *mod, enum rsnd_reg reg, u32 data); void rsnd_bset(struct rsnd_priv *priv, struct rsnd_mod *mod, enum rsnd_reg reg, u32 mask, u32 data); -u32 rsnd_get_adinr(struct rsnd_mod *mod); +u32 rsnd_get_adinr(struct rsnd_mod *mod, struct rsnd_dai_stream *io); /* * R-Car DMA @@ -537,8 +537,10 @@ unsigned int rsnd_src_get_ssi_rate(struct rsnd_priv *priv, struct rsnd_dai_stream *io, struct snd_pcm_runtime *runtime); int rsnd_src_ssiu_start(struct rsnd_mod *ssi_mod, + struct rsnd_dai_stream *io, int use_busif); -int rsnd_src_ssiu_stop(struct rsnd_mod *ssi_mod); +int rsnd_src_ssiu_stop(struct rsnd_mod *ssi_mod, + struct rsnd_dai_stream *io); int rsnd_src_ssi_irq_enable(struct rsnd_mod *ssi_mod); int rsnd_src_ssi_irq_disable(struct rsnd_mod *ssi_mod); diff --git a/sound/soc/sh/rcar/src.c b/sound/soc/sh/rcar/src.c index e28d9f6..5693bb5 100644 --- a/sound/soc/sh/rcar/src.c +++ b/sound/soc/sh/rcar/src.c @@ -129,9 +129,9 @@ static struct dma_chan *rsnd_src_dma_req(struct rsnd_mod *mod) } int rsnd_src_ssiu_start(struct rsnd_mod *ssi_mod, + struct rsnd_dai_stream *io, int use_busif) { - struct rsnd_dai_stream *io = rsnd_mod_to_io(ssi_mod); struct rsnd_dai *rdai = rsnd_io_to_rdai(io); struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io); int ssi_id = rsnd_mod_id(ssi_mod); @@ -174,7 +174,7 @@ int rsnd_src_ssiu_start(struct rsnd_mod *ssi_mod, u32 mask = ~0; rsnd_mod_write(ssi_mod, SSI_BUSIF_ADINR, - rsnd_get_adinr(ssi_mod)); + rsnd_get_adinr(ssi_mod, io)); rsnd_mod_write(ssi_mod, SSI_BUSIF_MODE, 1); rsnd_mod_write(ssi_mod, SSI_CTRL, 0x1); @@ -196,7 +196,8 @@ int rsnd_src_ssiu_start(struct rsnd_mod *ssi_mod, return 0; } -int rsnd_src_ssiu_stop(struct rsnd_mod *ssi_mod) +int rsnd_src_ssiu_stop(struct rsnd_mod *ssi_mod, + struct rsnd_dai_stream *io) { /* * DMA settings for SSIU @@ -283,9 +284,9 @@ unsigned int rsnd_src_get_ssi_rate(struct rsnd_priv *priv, return rate; } -static int rsnd_src_set_convert_rate(struct rsnd_mod *mod) +static int rsnd_src_set_convert_rate(struct rsnd_mod *mod, + struct rsnd_dai_stream *io) { - struct rsnd_dai_stream *io = rsnd_mod_to_io(mod); struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io); struct rsnd_src *src = rsnd_mod_to_src(mod); u32 convert_rate = rsnd_src_convert_rate(src); @@ -299,7 +300,7 @@ static int rsnd_src_set_convert_rate(struct rsnd_mod *mod) rsnd_mod_write(mod, SRC_SWRSR, 1); /* Set channel number and output bit length */ - rsnd_mod_write(mod, SRC_ADINR, rsnd_get_adinr(mod)); + rsnd_mod_write(mod, SRC_ADINR, rsnd_get_adinr(mod, io)); /* Enable the initial value of IFS */ if (fsrate) { @@ -508,12 +509,13 @@ static int rsnd_src_set_convert_timing_gen1(struct rsnd_mod *mod) return 0; } -static int rsnd_src_set_convert_rate_gen1(struct rsnd_mod *mod) +static int rsnd_src_set_convert_rate_gen1(struct rsnd_mod *mod, + struct rsnd_dai_stream *io) { struct rsnd_src *src = rsnd_mod_to_src(mod); int ret; - ret = rsnd_src_set_convert_rate(mod); + ret = rsnd_src_set_convert_rate(mod, io); if (ret < 0) return ret; @@ -547,7 +549,7 @@ static int rsnd_src_init_gen1(struct rsnd_mod *mod, if (ret < 0) return ret; - ret = rsnd_src_set_convert_rate_gen1(mod); + ret = rsnd_src_set_convert_rate_gen1(mod, io); if (ret < 0) return ret; @@ -706,11 +708,11 @@ rsnd_src_interrupt_gen2_out: return IRQ_HANDLED; } -static int rsnd_src_set_convert_rate_gen2(struct rsnd_mod *mod) +static int rsnd_src_set_convert_rate_gen2(struct rsnd_mod *mod, + struct rsnd_dai_stream *io) { struct rsnd_priv *priv = rsnd_mod_to_priv(mod); struct device *dev = rsnd_priv_to_dev(priv); - struct rsnd_dai_stream *io = rsnd_mod_to_io(mod); struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io); struct rsnd_src *src = rsnd_mod_to_src(mod); u32 convert_rate = rsnd_src_convert_rate(src); @@ -731,7 +733,7 @@ static int rsnd_src_set_convert_rate_gen2(struct rsnd_mod *mod) return -EINVAL; } - ret = rsnd_src_set_convert_rate(mod); + ret = rsnd_src_set_convert_rate(mod, io); if (ret < 0) return ret; @@ -834,7 +836,7 @@ static int rsnd_src_init_gen2(struct rsnd_mod *mod, if (ret < 0) return ret; - ret = rsnd_src_set_convert_rate_gen2(mod); + ret = rsnd_src_set_convert_rate_gen2(mod, io); if (ret < 0) return ret; diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c index 41ef475..564e829 100644 --- a/sound/soc/sh/rcar/ssi.c +++ b/sound/soc/sh/rcar/ssi.c @@ -396,7 +396,7 @@ static int rsnd_ssi_start(struct rsnd_mod *mod, { struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod); - rsnd_src_ssiu_start(mod, rsnd_ssi_use_busif(mod)); + rsnd_src_ssiu_start(mod, io, rsnd_ssi_use_busif(mod)); rsnd_ssi_hw_start(ssi, io); @@ -417,7 +417,7 @@ static int rsnd_ssi_stop(struct rsnd_mod *mod, rsnd_ssi_hw_stop(ssi); - rsnd_src_ssiu_stop(mod); + rsnd_src_ssiu_stop(mod, io); return 0; }