Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753571AbbGAJQX (ORCPT ); Wed, 1 Jul 2015 05:16:23 -0400 Received: from mail-bn1on0145.outbound.protection.outlook.com ([157.56.110.145]:22988 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752376AbbGAJQM (ORCPT ); Wed, 1 Jul 2015 05:16:12 -0400 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=freescale.com; vger.kernel.org; dkim=none (message not signed) header.d=none; Date: Wed, 1 Jul 2015 16:07:25 +0800 From: Zidan Wang To: Charles Keepax CC: , , , , , , Subject: Re: [alsa-devel][PATCH] ASoC: wm8960: update pll and clock setting function Message-ID: <20150701080723.GA22311@shlinux2> References: <5630bd343217e8fa895c5d133497f50739417453.1435316484.git.zidan.wang@freescale.com> <20150629094412.GH6321@opensource.wolfsonmicro.com> <20150630085347.GA22709@shlinux2> <20150630104200.GJ6321@opensource.wolfsonmicro.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20150630104200.GJ6321@opensource.wolfsonmicro.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BN1BFFO11FD027;1:PDqsVlbnegYpzA3PEDg2WjQeH5CUEm3hDQF9LD+4SUHaZCzuDDxJa/Z+mW7sdWHClHKAeLr0ChlGHaANa/ZXSvt8IPgPM52jJofQ+Fr9VlnY0rCpZVb48Hv5yTz8a4LkwoXdsfZNHsvCYR5RYDUqQTtAc4U0ISSLJti6CzexkGlxd863ReAY8NM1HTrJfvhL6JG30+6zaBcL4pATIAcUWNE6pqOYUcx2LumpoUJPvMhfvZ8jjzvKaYyxE1q4fSnIxmwE2S4y6a7k12/snhARGfcbCX6b1xoZvtq1E9KJRuG/tEnOhwcOLMJzffaXcSPsKGYAXLEdTH/sfn/UViVH9ElV/gskiqHhvveLsixRSmI= X-Forefront-Antispam-Report: CIP:192.88.158.2;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(2980300002)(1060300003)(339900001)(199003)(24454002)(164054003)(189002)(51704005)(19580395003)(33716001)(46406003)(105606002)(46102003)(77096005)(85426001)(92566002)(2950100001)(54356999)(110136002)(33656002)(104016003)(5001960100002)(93886004)(19580405001)(47776003)(50986999)(62966003)(50466002)(87936001)(77156002)(97756001)(76176999)(4290100001)(23726002)(6806004)(106466001)(110436001);DIR:OUT;SFP:1102;SCL:1;SRVR:BLUPR03MB277;H:az84smr01.freescale.net;FPR:;SPF:Fail;MLV:sfv;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BLUPR03MB277;2:b0KU9ABzg7lbQ6YX9JtV34QA8mqUALkW2/HWu3hVaJQhZ47jAWsuqfQQ+9E84cwV;3:HXNAOn3trEcUo0B5IaWQgGmbQ1cc/TbTO4UvyXu8I0cgYwn0tJH0/gBztuLc5BPCvXlIiKuXQBQMcXy/LJDCgnwO10BUN9yjGXsOvqAsYtxhD0/j/E4AYwo4bB6uWgcTaG9/MiAwMmcPUJKZa6F4xsya3K3Pm29+O7XW62Hmugbr41FlG3zveGTyWncYMJ5GMMPRHP5Mh8AsCc0rB/IbiTzRbBrZlCJ9i/TCHE7NjgE=;25:foQB2ODKTPtYtZv6Tfmc/qrgghnLlHnlxcgqVyb4DNaLw5/wd1EWBoFjm6MWx6MQ4iKIo+z1B+pQvtDPOawn68TN0GHBdTFaZHEx/TZkrbfgvy52TLLJJAGlIFfh6UsArf0038lWbSRJev6RIrzFn00IJ72XuFwm7asf3I+KFeUrh1+nHMcKURG6MOPVCYXSYwnZVvvBd/0m0qY4f83mbmpB+X6VuxOdr5i2+cUaPLGJLWUPWjdEFSjY7lVgxq8HWy0CJzNBBEUihKfI2Jp4ww==;20:kV82HEh6eP5HgGAMi1hUkcQBOCBDOahgYHNHw1vKLXLx0Av+G/DvRWGN5WvlR0Cy3NaLJ/WZNEliwf97FZErS8wxSin7cY262ZrNdu9Z5KB53oWKhmymJnQ1ISh+yAygRYutPj55C+Tp7Sxq7FAwGbIw/4ZA2MIQRV3/60ZLntD/kPhyPCSGg/yIAHwZpvNlRflMiq5v68bAqb9Zsn0MqXYg+8DOXcutM12iajY/BjLFdSxjNrBHm9Dpbb70DmgOMj+v+kxKUxy3i4nuBsLa3G+uDJf8eFV/xQVRlToPVw8EXxRO8tp0TpS6sEZPU/SHL37GFBrNBydh25M70x0t4MBfnFU5hmEdb2CZdvFiikA= X-Microsoft-Antispam: UriScan:;BCL:1;PCL:0;RULEID:;SRVR:BLUPR03MB277; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:1;PCL:0;RULEID:(601004)(1201001)(5005006)(3002001);SRVR:BLUPR03MB277;BCL:1;PCL:0;RULEID:;SRVR:BLUPR03MB277; X-Microsoft-Exchange-Diagnostics: 1;BLUPR03MB277;4:2bRKD1XP0CnBqTQ+raQ4+w9MZXwyfhc/rgpCjwPQYDD3hWj0QeG9pk3OLz6pTzroxoem9Y9TCsWnMcRtEY5AiIWEI6R06YFYSsBPnkoQI+misnTeMQGI8ZbNlRd17VlyUOwkgLielEObi6kOY4+jupDvCfBT8TDGfbA1x+cZKEHUACpaPdA9JvAwxdi3pMgkVoqRmmrU9+5TmDlurplOZCYWUBt47Ia7jEGPE1hIl4kVsPjYNNAIFDRUzztc8V4ktP3AiiDYqtiAts6sdYPi68NEVZJL114H+p6Cr8EfsGYhGleu1VxerguDtJbV70OM X-Forefront-PRVS: 0624A2429E X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BLUPR03MB277;23:nvl8p1jzl+GFqpi4tzG923GYvKLn4VC61hxJrRWjyO?= =?us-ascii?Q?f7dXupP31LyF4hMfa396vGrscrZBVqWchtBpLXsumbJyrQG+M7145YrelkAy?= =?us-ascii?Q?mknF346QDfE1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E8Dcl8dN41/IjX8ClhJqhMyd4B?= =?us-ascii?Q?M=3D?= X-Microsoft-Exchange-Diagnostics: 1;BLUPR03MB277;5:k0cuBFHjVQAa2qdcU+K49X84UXHZ11gs9+HAxfaxTPMz3+8o84/wrlNkg4C3zfxKMIzoIjlUxs0M4+GhD3cigwG4CqMQ72yg836AxbB1DoDKNosJxQpvuCrycFnS/5GJLoUq0X1zvg8iP0/MuYOxsQ==;24:6Rr3TBXNwUjxS1Ro2kAVT2uhpZ1algM77yfMQjhuahB0xJZS9Tx49zdTMJtl9sRoMWrXIipKUzjvPjDyVB9uN3SWJmmHFSFLghyK73vqIPU=;20:gxyvPlI7/TAjwG9TI5CE+oJ2rji0owcJLQBV0NDFxqlhPapnuaiDd/8Kr3Wop+aQUCKlVlkoe1htdj4edpUxWQ== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2015 09:16:07.9356 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d;Ip=[192.88.158.2];Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR03MB277 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2868 Lines: 62 On Tue, Jun 30, 2015 at 11:42:00AM +0100, Charles Keepax wrote: > On Tue, Jun 30, 2015 at 04:54:09PM +0800, Zidan Wang wrote: > > On Mon, Jun 29, 2015 at 10:44:12AM +0100, Charles Keepax wrote: > > > On Fri, Jun 26, 2015 at 07:09:22PM +0800, Zidan Wang wrote: > > > > When using snd_soc_dai_set_pll to set pll in machine driver, we > > > > should set pll in and pll out freq and ensure 5 < PLLN < 13, > > > > otherwise set pll will be failed. In order to support more > > > > formats and sample rates for a certain MCLK, if snd_soc_dai_set_pll > > > > failed, it will calculate a available pll out freq and set the pll > > > > again. > > > > > > > > Signed-off-by: Zidan Wang > > > > --- > > > > > > I think this need a little more explaination on how this is > > > expected to work. From looking at the code what it looks like > > > what happens is you can set a PLL frequency through set_pll but > > > then if that frequency doesn't support the sample rate requested > > > through hw_params it will be changed. This makes me a little > > > nervous, as something explicitly requested is being overwritten > > > automatically. > > > > > From RM, we should ensure 5 < PLLN < 13. When i using snd_soc_dai_set_pll > > to set pll frequency, it's hard for me to get a common pll out frequency. > > Sometimes, when codec MCLK or sample rate changed, the pll out frequency > > also should be changed, otherwise set_pll function will be failed. > > > > I made it to auto select pll frequency when snd_soc_dai_set_pll failed, so that > > it can support more sample rate, and don't need to set different pll out > > frequency for different sample rate and different MCLK. > > But none the less I still asked for one frequency and got another > frequency, that seems troubling. For example the chip has the > ability to output the PLL output on GPIO1, what if that is being > used to feed another chip that expects a certain rate? > > What are your feeling on my previous suggestion of adding a > particular define that indicates set the PLL to "auto" mode? Yes, you are right, overwritten the setting is not a good idea. I will change code to support "auto" mode. When it's "auto" mode, if the MCLK can provide sysclk, using MCLK directly, otherwise, auto select pll frequency and set PLL. Do you think it make sense? Best Regards, Zidan Wang > > Thanks, > Charles > > > > > > Would it perhaps be better to allow the auto selection of the > > > PLL frequency only when things haven't been manually set, or > > > provide some setting that indicates auto mode? > > > > > > Thanks, > > > Charles -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/