From patchwork Thu Feb 18 08:17:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 8347171 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-renesas-soc@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 929FCC0553 for ; Thu, 18 Feb 2016 08:17:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E51BB20395 for ; Thu, 18 Feb 2016 08:17:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2D16020386 for ; Thu, 18 Feb 2016 08:17:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1425114AbcBRIRX (ORCPT ); Thu, 18 Feb 2016 03:17:23 -0500 Received: from relmlor3.renesas.com ([210.160.252.173]:18077 "EHLO relmlie2.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1424633AbcBRIRW (ORCPT ); Thu, 18 Feb 2016 03:17:22 -0500 Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie2.idc.renesas.com with ESMTP; 18 Feb 2016 17:17:21 +0900 Received: from relmlac4.idc.renesas.com (relmlac4.idc.renesas.com [10.200.69.24]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id 93B0948DDD; Thu, 18 Feb 2016 17:17:21 +0900 (JST) Received: by relmlac4.idc.renesas.com (Postfix, from userid 0) id 8BCC2480A4; Thu, 18 Feb 2016 17:17:21 +0900 (JST) Received: from relmlac4.idc.renesas.com (localhost [127.0.0.1]) by relmlac4.idc.renesas.com (Postfix) with ESMTP id 8442B480A3; Thu, 18 Feb 2016 17:17:21 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac4.idc.renesas.com with ESMTP id TAR23893; Thu, 18 Feb 2016 17:17:21 +0900 X-IronPort-AV: E=Sophos;i="5.22,464,1449500400"; d="scan'";a="204626191" 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:17:20 +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=vf0UyeSwwZrdPvBjHGsZuwBa5LAKLDFPccbg5dmKOsE=; b=BTvCw5Lyig1H8Z6roxhOSf6fLr/LGtZyYSDCgKT6Ym2f0hLaUTMz+v3Fl9BqvzuItinO/B1oMvUJPYAMF7xhPqW9UCMnpuiIzENaaf6YB+kKFbtRqnjKs9afPrwDwkaksK9FoRla2Npi2UgQb4E1j+F9bDrWXTyy3h9Px3nIH9E= 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 HKXPR06MB1013.apcprd06.prod.outlook.com (10.161.137.28) with Microsoft SMTP Server (TLS) id 15.1.409.15; Thu, 18 Feb 2016 08:17:18 +0000 Message-ID: <87io1mtp0w.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 07/11] ASoC: rsnd: tidyup SSI init/start sequence 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:17:18 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: OS1PR01CA0044.jpnprd01.prod.outlook.com (25.164.162.26) To HKXPR06MB1013.apcprd06.prod.outlook.com (25.161.137.28) X-Microsoft-Exchange-Diagnostics: 1; HKXPR06MB1013; 2:Am7iCmvhocTsyt/MYNA9N/eOxSIuMeDJJCqXEoZgi1THZzw0pGpfQLYLoBTVjHDLkFP2mo3wsEJpNt/uLeSmoKlIAoSOvvKFOo1VMwdP5xlqVezNVzsjc8i/GpIofv58vtSX5m6SimIOYzDT+if6bg==; 3:a/QnW01jN25QjSI28uZz82akCt9fIqKrHDJjpdofhJtQw7mDKnVw17yT/f1dEVwSAtrOr9lSbgEOjK4zTv3PEL/k8bc/VvSLuq/hxkwSa+sW3+kumUOPR131VzD4F6I0; 25:LoeuKSNwHikBj0TxXFXYBylc3V4vbsUh8B9eq2MgXPY7reFDnFfnUiA70tINhtJJT0etzKzD/x2u5OzTTKysxTM5kd60+57XVXcrs/3lbUxtW/otwhTUZB0xH4lxV9eVZSBfRIixeF0lXlRC5XZ3VhjpIVhumpI8iWaksm429yFrgYd9MjL/BZWj+YG+A3esahorhDixtlruuqrXrlYIA3qF8Og59eM7gwbpuvAZRiIDI0zU7Qyk5SoyJ5UqZSiRxmqvy1tQwl2aJOL9izqZUPimAQrxG8ZUPb1v81EoQW1zFpBYD4G+7lXYfB5MevwA X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HKXPR06MB1013; X-MS-Office365-Filtering-Correlation-Id: f196841c-9529-445f-e6c0-08d3383beb66 X-Microsoft-Exchange-Diagnostics: 1; HKXPR06MB1013; 20:faCQ5vOEIFvmQojXkYD012wuo+/EappFXxXcQzSb+YjLkY/sxxZH/u9amdfKrl1385t9GZSFcjmibBnhDg2V4PbzdiggJ6DAoenVoUIqYPuutho28y6J4fa4u6mI7AntPgCDw5Iuwwgt7BPTFRrMcIQLj5q4ca7AWAemzneHnnJyczZvG8e0bkZ0jL3fLHUaEF8Bm3P6F3ZeLqR04K969ivTUXInMS2+jKpCiiLPL3YYivv/FjQucOFR0QEFrKXdsxaiXHQ80H2bN+Ix+Xa2IWd6KPTUcxoebs+o+nqGrC6gI4LXIIKtGt6c55udReRGcLR6jVkvide1OuEISwDN/w+m0Lj8HUeb+wpxuaG4+NU0z98rLbtLCmzWL5i2AC/w/qoUrokvcLnQNZY4ooD5xjO33mrQzpIWDdrJ7IBddKrkor6UUFznhGnm7QTVB0BkK42Sv53cyE7OoWg7UVmwaw+I7MI4t4pyD2yRLMZHTgejPPw8OQqGJqNzY0BBNBW6; 4:ROfU7tcgKeuLN2lfTvK1w1SYeT3jQYWl+d0ujZsI4HVmF0bSGXllS7k7sc8gioTolni488YyHsr7qx3N385MqvSI8ZFfz2ArN81dVGGjoj5uH5xIqLQktIpopbhh9UnflX73vxsvHrp8l4H2U/shw4zaT2uN9dV/fJh7WeM4ieWIeHGtLnlfX88YPsfpdt6/cHNaiN3R9LvCqF1r7NvjbK+qT4DJCsg2gJMBqbk86AWPUKf5BdpygiTaP1pztVZcYuX4XgLT3PeaHS6GbsMhSU12RWRQ42QzY6yPMa2s9lyWvmobAM3Ydd1/lI07gR6TfQjIDE+iiZW/REPFNyALyDxvPxlxUQuSGIfJooyTGc4= 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:HKXPR06MB1013; BCL:0; PCL:0; RULEID:; SRVR:HKXPR06MB1013; X-Forefront-PRVS: 085634EFF4 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(92566002)(229853001)(122386002)(4001350100001)(5001960100002)(189998001)(110136002)(19580395003)(50466002)(19580405001)(83506001)(46406003)(40100003)(33646002)(5008740100001)(50986999)(76176999)(36756003)(5004730100002)(3846002)(86362001)(586003)(53416004)(87976001)(42186005)(1096002)(2950100001)(77096005)(2906002)(47776003)(4326007)(23726003); DIR:OUT; SFP:1102; SCL:1; SRVR:HKXPR06MB1013; H:morimoto-PC.renesas.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; HKXPR06MB1013; 23:PxhkBr6oxtNqDmmv8HdEMm7dMfm3hJgX7WLQdnjzZ4Ta5IYdk1Iu2umf3hvvqZK+yjdehrOeiOI6YkC9Gfbct34Z81RGA/LpfWDQwj23sPnm8wb2xtrbkFQvN5s5DgsDI38u9/3Gmzl3ilsnItiHiY2KD9pjB7u2q8iKk6iwAvihKIr4z+XFwhiewxw83LWoeUb9WIYxSElt3RLImDDTOJwlOvs2r3PheAnPlDtYlm6D7tAqgz4YYEZDbk3mR8m8FTpwcaiSVwVwmAFoB4X72kCXBAF7GGnNDoWTSRggB/AYdvHLgNPiPww8IzQPXEjjB/Kbko1+ZKDss3DVxaVn1toCpfeFr5w6gjBUxdrzut4rFVLr47ZKIvAj+tAS6pUui+JNK4rn3x09cRwofToQJSFdHdCWBxN4deSOut4h7Ku+BwDVUZlEZ0WJ8tws469V22riYbRaP9OG6JFmjSNFOwUwOgbXsAOGCzlynZ3PUC2EXlEYLuA7rm0wvccNYzaBRm1QexwyZrB6yUHRhGa2l4e+ACWjxy65JQfOTjIp3m6Nya6wHEulsX7fES5adof9b7+ZcjSP5aTBhpswGPzjiNSLbLfqBx418DU+hNNkXk+wHeFrNFVMxTSDvkfhK3vwJrX0NaakmwKwTFf1NSU5gZtZiCjQyJoPd2KZr3BMFE6MF6fy+Zd7dal/bj/W/cbZuH7ZWznLhz2EmffmHO8PvKehzaeyS2UacPGD5l93/P5RFbvGRKivNDrNMGwBaDtcOIXPvC0/WHJXtzm0K+P2PKtNwiE6XHRGIMTLheRNs9RxXHKzlZSCEN28xEnxJn+uQmvA9taY44NuSRbMPr26GW4HCKZ/jYvLlKA6N5SZ5L9axKT0rM8S9TfUG9U5ZZCYZ0AG9JoXtinHYnu0DbYcNC11gUGOXXKYtYs9oBGRK vKeTPdGUESCZVw4qxF77kv1 X-Microsoft-Exchange-Diagnostics: 1; HKXPR06MB1013; 5:PiJSngi9tu6fmRGWjDtwQ3D+C7kgtlETpxIWqcRVDoHfjJzi+1is2qJnyh1r2BnoRAdm6i5Wl5WWuk5VGqIY2bxckcU7Gqhi5rchKRGCgZXq7R4vwU4O9vJw/isi6+n9zyKWrwJ0H/k8B6FQCSD/kg==; 24:8FsKbID0nZDcNOt+dfFQVg4Jr0K+VNfO3Mza6eMojZ78RwI4JwZ7GjCNsKkesOYC+Ikd9zoa6n6QvChthbtq0tDncbGJHOVHU+WpOR4OgXU=; 20:WLdy5iEoiZoTyCTdLbnQgCwF2TLlBD2HfZEhOzqcOE6ZoXpY3cG6+KZkcbp0Gd/0JA/Q2aimjXyYjyfviNGQ42o5yLy8VClUCx4fAgfzrS0atPQZc5hHwJMDFBrET2NfTMokflUNy5aEzckA+3gTh5WlIDPMvnfPmRUXvpp+fo4= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Feb 2016 08:17:18.7518 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HKXPR06MB1013 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 SSI want to have SSIWSR settings and SSICR settings without EN bit when init, and SSICR EN bit only when start timing. Otherwise, SSI output signal might be unstable. Signed-off-by: Kuninori Morimoto --- sound/soc/sh/rcar/ssi.c | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c index b1a29e2..1205872 100644 --- a/sound/soc/sh/rcar/ssi.c +++ b/sound/soc/sh/rcar/ssi.c @@ -276,7 +276,7 @@ static void rsnd_ssi_master_clk_stop(struct rsnd_mod *mod, rsnd_adg_ssi_clk_stop(mod); } -static int rsnd_ssi_config_init(struct rsnd_mod *mod, +static void rsnd_ssi_config_init(struct rsnd_mod *mod, struct rsnd_dai_stream *io) { struct rsnd_dai *rdai = rsnd_io_to_rdai(io); @@ -313,8 +313,6 @@ static int rsnd_ssi_config_init(struct rsnd_mod *mod, case 32: cr_own |= DWL_24; break; - default: - return -EINVAL; } if (rsnd_ssi_is_dma_mode(mod)) { @@ -338,8 +336,16 @@ static int rsnd_ssi_config_init(struct rsnd_mod *mod, ssi->cr_own = cr_own; ssi->cr_mode = cr_mode; ssi->wsr = wsr; +} - return 0; +static void rsnd_ssi_register_setup(struct rsnd_mod *mod) +{ + struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod); + + rsnd_mod_write(mod, SSIWSR, ssi->wsr); + rsnd_mod_write(mod, SSICR, ssi->cr_own | + ssi->cr_clk | + ssi->cr_mode); /* without EN */ } /* @@ -360,12 +366,10 @@ static int rsnd_ssi_init(struct rsnd_mod *mod, if (ret < 0) return ret; - if (rsnd_ssi_is_parent(mod, io)) - return 0; + if (!rsnd_ssi_is_parent(mod, io)) + rsnd_ssi_config_init(mod, io); - ret = rsnd_ssi_config_init(mod, io); - if (ret < 0) - return ret; + rsnd_ssi_register_setup(mod); /* clear error status */ rsnd_ssi_status_clear(mod); @@ -428,22 +432,14 @@ static int rsnd_ssi_start(struct rsnd_mod *mod, struct rsnd_dai_stream *io, struct rsnd_priv *priv) { - struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod); - u32 cr; - - cr = ssi->cr_own | - ssi->cr_clk | - ssi->cr_mode; - /* * EN will be set via SSIU :: SSI_CONTROL * if Multi channel mode */ - if (!rsnd_ssi_multi_slaves(io)) - cr |= EN; + if (rsnd_ssi_multi_slaves(io)) + return 0; - rsnd_mod_write(mod, SSICR, cr); - rsnd_mod_write(mod, SSIWSR, ssi->wsr); + rsnd_mod_bset(mod, SSICR, EN, EN); return 0; }