From patchwork Thu Feb 18 08:18:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 8347221 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-renesas-soc@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 9F4DB9F399 for ; Thu, 18 Feb 2016 08:19:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CBAE5203A0 for ; Thu, 18 Feb 2016 08:19:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E6919202A1 for ; Thu, 18 Feb 2016 08:18:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1425114AbcBRIS7 (ORCPT ); Thu, 18 Feb 2016 03:18:59 -0500 Received: from relmlor4.renesas.com ([210.160.252.174]:27142 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1425026AbcBRIS6 (ORCPT ); Thu, 18 Feb 2016 03:18:58 -0500 Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie3.idc.renesas.com with ESMTP; 18 Feb 2016 17:18:57 +0900 Received: from relmlac1.idc.renesas.com (relmlac1.idc.renesas.com [10.200.69.21]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id 42B8B48E9D; Thu, 18 Feb 2016 17:18:57 +0900 (JST) Received: by relmlac1.idc.renesas.com (Postfix, from userid 0) id 39B498002E; Thu, 18 Feb 2016 17:18:57 +0900 (JST) Received: from relmlac1.idc.renesas.com (localhost [127.0.0.1]) by relmlac1.idc.renesas.com (Postfix) with ESMTP id 324DE8002D; Thu, 18 Feb 2016 17:18:57 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac1.idc.renesas.com with ESMTP id TAC09491; Thu, 18 Feb 2016 17:18:57 +0900 X-IronPort-AV: E=Sophos;i="5.22,464,1449500400"; d="scan'";a="204626325" Received: from mail-sg2apc01lp0239.outbound.protection.outlook.com (HELO APC01-SG2-obe.outbound.protection.outlook.com) ([65.55.88.239]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 18 Feb 2016 17:18:56 +0900 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector1-renesas-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=TBlMbqFCCK68drJmZDqWyj7iTtRncGk7UuOW203ntPc=; b=ETVjkkfLxtAS5ExxecKDgnjPlP1QMpYsAl6p+As6ZRxbajdxpB7fLHsJguoICAT0PfaEBNehjKTPZmlcyhqM8RHd5bvEz4HluXDknxDSCVwjZlTZjXZp9DzZQs18Eiux+p+aVZguc4ERI8tQ3K3TUZ3erc4bfI8hFogouz2Z67s= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; kernel.org; dmarc=none action=none header.from=renesas.com; Received: from morimoto-PC.renesas.com (211.11.155.144) by HKXPR06MB1014.apcprd06.prod.outlook.com (10.161.178.156) with Microsoft SMTP Server (TLS) id 15.1.409.15; Thu, 18 Feb 2016 08:18:54 +0000 Message-ID: <87egcatoy7.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 10/11] ASoC: rsnd: judge multi SSI in runtime User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 To: Mark Brown CC: Linux-ALSA , Liam Girdwood , Simon , In-Reply-To: <87si0qtp8x.wl%kuninori.morimoto.gx@renesas.com> References: <87si0qtp8x.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Thu, 18 Feb 2016 08:18:54 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: OS2PR01CA0047.jpnprd01.prod.outlook.com (25.164.161.157) To HKXPR06MB1014.apcprd06.prod.outlook.com (25.161.178.156) X-Microsoft-Exchange-Diagnostics: 1; HKXPR06MB1014; 2:ckCALwN2l/Zi2oaAK8WshnYGdY3rmbFI21er9oV0zbdsb40hGYNcRD7kd8sU1e2pZ8jnZSHv85oVflSNgh3C/lKATRMa42WNNoXWZlNz/QqG8KCEqJdoMqh8TOcE2JV325G75K38cw+OMAG7NW7TbQ==; 3:dL3g4aftwXSh2uhoMUnMCuUpOcxc9Xu7oXaKwugfHCG2sShU2tVmb1+sRRmbRg7Xnk6ww2cCKiUc9UKWkTf6WDSe2EVxGfgIDVlwo1xTNs7RS0CWqw0NUvlQeo7QhZXw; 25:0DzE0YAjstFxxKCgdW1wukS9jZcWSJgG+iez4sFifxEbHeUAtGYTAmxSEkRg0d6poA4jk4zVCB4ZyZHzOIWz1AZHAe2mqwRPUt6XCq4kwa69eEKsS0QFgqXQK7m1jjgNg7YyY4hgSKCfKqkAU449BhlaoZciS/CJkcwfRUr3/6XF0tb03AOGhXikRWHtyrNa9EzpBd1sH0AgERtOoobxAJq+hmiM8su4FpxnKDwDqOeq5yAUrxIl7t1KwGaPH4G4FCXzEZgdE7MpQwBX7kiGAwnWQUF/fdiLsM5uF/93oOrj0tHNE7Wy/c/7btoK0zKl X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HKXPR06MB1014; X-MS-Office365-Filtering-Correlation-Id: c3f05dc9-ebab-48d3-fe84-08d3383c2434 X-Microsoft-Exchange-Diagnostics: 1; HKXPR06MB1014; 20:ncahRQTjTobaKuwKR/Zt098eO0lWEuaNf94Lp0vGvfHNmaVGdbbW+XA6JDKhC2YE5SRWImb/pHQnvjT/FzZaBaRGbxOk+DdMj1qYoYPtsc1iHJfH/+juTSxBUMdjLJBuMeAj/jXYAj5IRFC/RdtlMx3nFW0hSEPM908mw2xGIdf1eUQEvNEFv3Yl21jWUZwM+y0TKTDreYcZ0G4D4QDSXJ6o+vcaVpLWFsIpW2MFXGhsyxcdVL3xlTgsgtMJs7oFY1uZKZBYLd/3jGGZ16/23ouJzWP8Y6g1OhGm1HYCtrXIK6mvB3xec0Ps8aqiFwYGCE+WT0sQqYgkBkWD8I8G7n7Gxp8eL7Dcd3zYFhnY2tVf+OIMI6wmTsL6hpf6FhbU/+1ZAUN9BJnNQa73MsrhgNNFnOtoPuK22rw/XY6TaWouYN+Vc0V72IlYRDdDq4/QS0HGExkTxJbqw3VPaBrSoToAvDBOFpgEPSOWuqS1FyZ3fOev+20Wa3QafBLtotCS; 4:Psl/Y0zPF+D7zfMxFCpRAHFnV8HsMEHzmRPR/l9elBztK/Z3P7xlnW5H8qjyZU0EBZyyogz7OX2ka0MJqPCGUEjrUaJ7Q1mWSquzyVgdrlh9nOTs2ZKyFVcIxYUsdsQYgYgAk2cYVSq4UV0iYaJwr+z85f2sm3fk56jDomW/tO1FyzTzpH9BJnO5qLB1ixHXrvtR3hC48B93Kfr/caxCm8HpKdUNi+OYmqD5KUc+aWR7GckFq+S8YsafYu+h+6vPTeMpXJI4PyOTPu2thAVBb5+A52roEGGt+pux/JvjdYQQ8352jxsVZuI3Tw+B/Lex+SUgPhx7w8THsKy5dZrzzhOJGzYaSK5dodRG9a7iYOIfEgH5wwTTl/TbnF0uVpo5 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001); SRVR:HKXPR06MB1014; BCL:0; PCL:0; RULEID:; SRVR:HKXPR06MB1014; X-Forefront-PRVS: 085634EFF4 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(19580395003)(83506001)(19580405001)(36756003)(229853001)(23726003)(87976001)(5008740100001)(47776003)(4001350100001)(1096002)(50466002)(50986999)(53416004)(76176999)(575784001)(4326007)(92566002)(189998001)(3846002)(586003)(110136002)(33646002)(86362001)(42186005)(5001960100002)(5004730100002)(46406003)(77096005)(122386002)(2950100001)(2906002)(40100003); DIR:OUT; SFP:1102; SCL:1; SRVR:HKXPR06MB1014; H:morimoto-PC.renesas.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HKXPR06MB1014; 23:VurVxxQ+FuD0HZ/XGJV0Efw7e+2jeO6M0wec69np5?= =?us-ascii?Q?ttDjE6GxyJtRbd6Ltz1NvsowaEoAyxe9UN+w3BByu+Yy0bt0qGsdbPglM9MO?= =?us-ascii?Q?T1O+M6RoxJzUmeCIbh3lBLMkaVGyTjZ+wsDgtW18qaUFitSKUgfk4hQB9R4J?= =?us-ascii?Q?6DHzbZH/CvGa5lOas2vUZ/4jthhnLp4LDc5T/C5kR1UzgRf5fOtLjTa9khCj?= =?us-ascii?Q?KVmnsGLHdz8WimBXnpBrVxxhLyOzgw4id4epAt4spL2rAmYxpMhJ+h4OQnlg?= =?us-ascii?Q?+p8B3V3LF/zzjXXRUR0bhCdSt5+xi3S19qkQaVZlMEaq/cPg8J+P71nMawCv?= =?us-ascii?Q?N4rKeMTg69QQZH/VnyWMMREhTCiRSL96CCXLRvgw+uW7tsK2r/gdC3fAzA61?= =?us-ascii?Q?zr8kBNWfM6H2IhXbwEm6oasaqgm8BwiNaRgPxodPrpTPzsdoKlKnbUsqaCvn?= =?us-ascii?Q?41tQ8v6dW1l4QwOQ8q7erEKix+0amdvC1BPcKb7QL8vryQkjnrOJe6w5TJcs?= =?us-ascii?Q?OGhRHOHXhjF4txiEw0EVB9SFgTuLNS/CiU5FV2ctjIXI4DWLzqQMKvLskeEb?= =?us-ascii?Q?pZhj6IoSN48jt1962HX+A3NLZ5JX+NWW1nIDuedjMZaEe4KB9ZKUsnnrlUro?= =?us-ascii?Q?EwO1BA/t0SL1FXSSCFvJ8yozWcGziUI6b9bfleC5H8VU2VY5ns18Vn7W7RAl?= =?us-ascii?Q?RynTjmY7uc5Jlm7ptdPUUyRECCCKgIn3I6XkR2+G3sGhJHzwF+FaT2rEEd6a?= =?us-ascii?Q?wN9m5GAL4eqWfLKG67W4T3ieH8ZLhxCK4zmwMdEm5aKCCLoWbsShJ6NS4nZn?= =?us-ascii?Q?1Di2b2gzgsi5Lv4ayWerZjyADtZfPJOlKZsTH/lL73Kj5zqU5pWmtxCM9IV5?= =?us-ascii?Q?t2kwOmHDMlUIx2buUYMyxVVgtKGx2YFzQEuOo5Q/ExeNkDhTN2sr/1k3Y7qS?= =?us-ascii?Q?y25yOU39vXghbE86IADL1FoPxeodCuycuXaM+B5Ew=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; HKXPR06MB1014; 5:JeepJJshJkGFighMqdcVpq/wQA+zmImz/NW+jcGx8FBGzDPgZz3rej/54HHn+lkyP7ssxaC+GoDkGRN0ZGOGjzz5l8WPLhtV8MbVFAdh1CVs54RlxNZFEBYFwdzuelYsTwHmfdXwOQ1IDGCU8r8hFg==; 24:QcJtzdPUN2r8YTg06v9rMjsw6a36YK9i1nwBhHklTBR6QFEGtduPxjaSIw6tN/NYevBOS3JFu+m+hLIhG/E3aW45tnqGGHqzfGV3pUcywpQ=; 20:gHdGRWfDrImRf3fZzlbxgeQyvpaEOzYBoV76It23r5B7vGE5H0c9r9iCFKw2bhOancLdnt8GBZmshaBHrKoowsyqCTx/M0/F1Cs43WS/4dn43Zsu1aes7q3mT4fAOO+M/BKk++KG6jTujDWLVZPmRwqTUu1y1dirjnfAe0oM/Lg= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Feb 2016 08:18:54.0549 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HKXPR06MB1014 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto Current rsnd supports multi SSI (maximum 4 SSI for 8ch), and, it should determine whether using each SSI or not in runtime. Current judgement is vague, and had broken by c308abe45e2("ASoC: rsnd: rsnd_ssi_is_multi_slave() macro uses rsnd_ssi_multi_slaves()") This patch makes clean it, and solve this issue. Signed-off-by: Kuninori Morimoto --- sound/soc/sh/rcar/core.c | 2 +- sound/soc/sh/rcar/rsnd.h | 2 +- sound/soc/sh/rcar/ssi.c | 15 +++++++++++++-- sound/soc/sh/rcar/ssiu.c | 6 +++--- 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c index f65e93e..21e13b3 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c @@ -230,7 +230,7 @@ int rsnd_get_slot_width(struct rsnd_dai_stream *io) int chan = runtime->channels; /* Multi channel Mode */ - if (rsnd_ssi_multi_slaves(io)) + if (rsnd_ssi_multi_slaves_runtime(io)) chan /= rsnd_get_slot_num(io); /* TDM Extend Mode needs 8ch */ diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h index 61cb4ae..5f613eb 100644 --- a/sound/soc/sh/rcar/rsnd.h +++ b/sound/soc/sh/rcar/rsnd.h @@ -599,7 +599,7 @@ void rsnd_ssi_remove(struct rsnd_priv *priv); struct rsnd_mod *rsnd_ssi_mod_get(struct rsnd_priv *priv, int id); int rsnd_ssi_is_dma_mode(struct rsnd_mod *mod); int rsnd_ssi_use_busif(struct rsnd_dai_stream *io); -u32 rsnd_ssi_multi_slaves(struct rsnd_dai_stream *io); +u32 rsnd_ssi_multi_slaves_runtime(struct rsnd_dai_stream *io); #define rsnd_ssi_is_pin_sharing(io) \ __rsnd_ssi_is_pin_sharing(rsnd_io_to_mod_ssi(io)) diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c index d46bc08..32f1f5f 100644 --- a/sound/soc/sh/rcar/ssi.c +++ b/sound/soc/sh/rcar/ssi.c @@ -144,7 +144,7 @@ static void rsnd_ssi_status_check(struct rsnd_mod *mod, rsnd_mod_name(mod), rsnd_mod_id(mod)); } -u32 rsnd_ssi_multi_slaves(struct rsnd_dai_stream *io) +static u32 rsnd_ssi_multi_slaves(struct rsnd_dai_stream *io) { struct rsnd_mod *mod; enum rsnd_mod_type types[] = { @@ -166,6 +166,17 @@ u32 rsnd_ssi_multi_slaves(struct rsnd_dai_stream *io) return mask; } +u32 rsnd_ssi_multi_slaves_runtime(struct rsnd_dai_stream *io) +{ + struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io); + u32 mask = rsnd_ssi_multi_slaves(io); + + if (mask && (runtime->channels >= 6)) + return mask; + + return 0; +} + static int rsnd_ssi_master_clk_start(struct rsnd_mod *mod, struct rsnd_dai_stream *io) { @@ -415,7 +426,7 @@ static int rsnd_ssi_start(struct rsnd_mod *mod, * EN will be set via SSIU :: SSI_CONTROL * if Multi channel mode */ - if (rsnd_ssi_multi_slaves(io)) + if (rsnd_ssi_multi_slaves_runtime(io)) return 0; rsnd_mod_bset(mod, SSICR, EN, EN); diff --git a/sound/soc/sh/rcar/ssiu.c b/sound/soc/sh/rcar/ssiu.c index 11e5588..1b8ea0e 100644 --- a/sound/soc/sh/rcar/ssiu.c +++ b/sound/soc/sh/rcar/ssiu.c @@ -27,7 +27,7 @@ static int rsnd_ssiu_init(struct rsnd_mod *mod, struct rsnd_priv *priv) { struct rsnd_dai *rdai = rsnd_io_to_rdai(io); - u32 multi_ssi_slaves = rsnd_ssi_multi_slaves(io); + u32 multi_ssi_slaves = rsnd_ssi_multi_slaves_runtime(io); int use_busif = rsnd_ssi_use_busif(io); int id = rsnd_mod_id(mod); u32 mask1, val1; @@ -136,7 +136,7 @@ static int rsnd_ssiu_start_gen2(struct rsnd_mod *mod, rsnd_mod_write(mod, SSI_CTRL, 0x1); - if (rsnd_ssi_multi_slaves(io)) + if (rsnd_ssi_multi_slaves_runtime(io)) rsnd_mod_write(mod, SSI_CONTROL, 0x1); return 0; @@ -151,7 +151,7 @@ static int rsnd_ssiu_stop_gen2(struct rsnd_mod *mod, rsnd_mod_write(mod, SSI_CTRL, 0); - if (rsnd_ssi_multi_slaves(io)) + if (rsnd_ssi_multi_slaves_runtime(io)) rsnd_mod_write(mod, SSI_CONTROL, 0); return 0;