Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932337AbdLOPTX convert rfc822-to-8bit (ORCPT ); Fri, 15 Dec 2017 10:19:23 -0500 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:31413 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932292AbdLOPTQ (ORCPT ); Fri, 15 Dec 2017 10:19:16 -0500 From: Olivier MOYSAN To: Mark Brown CC: "lgirdwood@gmail.com" , "perex@perex.cz" , "tiwai@suse.com" , "mcoquelin.stm32@gmail.com" , Alexandre TORGUE , "alsa-devel@alsa-project.org" , "linux-arm-kernel@lists.infradead.org" , "kernel@stlinux.com" , "linux-kernel@vger.kernel.org" , Arnaud POULIQUEN , Benjamin GAIGNARD , "patches@opensource.wolfsonmicro.com" Subject: Re: [RFC PATCH 2/2] ASoC: select sysclk clock from mlck clock provider in wm8994 driver Thread-Topic: [RFC PATCH 2/2] ASoC: select sysclk clock from mlck clock provider in wm8994 driver Thread-Index: AQHTdPx0zYMJOMWsoEelRgeNYpin66NDCWMAgAFq5AA= Date: Fri, 15 Dec 2017 15:15:22 +0000 Message-ID: <43426b67-3546-8422-7fcb-9fa1ff192679@st.com> References: <1513270438-18523-1-git-send-email-olivier.moysan@st.com> <1513270438-18523-3-git-send-email-olivier.moysan@st.com> <20171214173624.GM9788@sirena.org.uk> In-Reply-To: <20171214173624.GM9788@sirena.org.uk> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.75.127.44] Content-Type: text/plain; charset="Windows-1252" Content-ID: Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-12-15_06:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1424 Lines: 40 Hello Mark, Thanks for your comment. On 12/14/2017 06:36 PM, Mark Brown wrote: > On Thu, Dec 14, 2017 at 05:53:58PM +0100, Olivier Moysan wrote: >> When defined in device tree, MCLK1 and MCLK2 are used >> as sysclk for aif1 and aif2 interfaces respectively. > > That's not a valid assumption as far as I remember? The AIFs can use > either MCLK depending on the system configuration I think. > You are right. wm8994 allows to select either MCLK for each AIF. From this point of view, the current patch is too limiting. MCLK information in DT allows to enforce MCLK use, but an additionnal information is required to determine AIF MCLK assignment. Available properties in codec DAI node, such as clocks property, cannot help here. Maybe a DAPM linked to a control is a better way to select AIF source, When source is not provided by clk_id in wm8994_set_dai_sysclk(). In this case, wm8994_set_dai_sysclk() would only have to check if clock source is not already set. Please let me know if this option sounds better to you. >> If clock rate is let 0, the frequency provided by >> wm8994_set_dai_sysclk() is used instead. > > I'd expect this the other way around, if we didn't specify a frequency > then read it from the input otherwise try to use clk_set_rate() to > propagate things up. > If I implement a control to select the AIF source, I will drop the code related to mclk clock provider. Regards Olivier