From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755296AbcBXQKR (ORCPT ); Wed, 24 Feb 2016 11:10:17 -0500 Received: from mga01.intel.com ([192.55.52.88]:20922 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751813AbcBXQKP (ORCPT ); Wed, 24 Feb 2016 11:10:15 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,494,1449561600"; d="scan'208";a="910349279" Subject: Re: [alsa-devel] [PATCH] ASoC: rt5640: add master clock handling for rt5640 To: Mark Brown , Heiko Stuebner References: <1456190782-18865-1-git-send-email-sugar.zhang@rock-chips.com> <56CC719C.1090901@linux.intel.com> <2199435.lA9iTvxnKV@phil> <20160224033259.GL18327@sirena.org.uk> Cc: Mark Rutland , Oder Chiou , alsa-devel@alsa-project.org, Pawel Moll , Ian Campbell , Liam Girdwood , Takashi Iwai , linux-kernel@vger.kernel.org, Sugar Zhang , devicetree@vger.kernel.org, Rob Herring , Kumar Gala , Bard Liao From: Pierre-Louis Bossart Message-ID: <56CDD5DD.6040006@linux.intel.com> Date: Wed, 24 Feb 2016 10:10:05 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <20160224033259.GL18327@sirena.org.uk> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/23/16 9:32 PM, Mark Brown wrote: > On Wed, Feb 24, 2016 at 12:08:31AM +0100, Heiko Stuebner wrote: >> Am Dienstag, 23. Februar 2016, 08:50:04 schrieb Pierre-Louis >> Bossart: > >>> This patch assumes that the information on mclk comes from >>> DeviceTree. The mclk may also be enabled/disabled in the machine >>> driver with an explicit transition to use an internal clock when >>> the codec is not used. I hope this patch doesn't preclude such >>> usages or there will be a conflict with the patches we are about >>> to upstream for Baytrail/cht devices. > >> As you can see, the clock property itself is optional and the >> clk_get below acts accordingly of also continuing if the clock is >> not present. So it won't affect any users doing it otherwise. > > That said we really do need x86 to transition to use the clock API > in order to integrate with external devices, where the machine driver > does manage clocks we want that to move to being done using the clock > API rather than custom APIs. For Baytrail audio we have a single platform clock that can be turned on/off and set to 19.2 MHz or 25 MHz. No other controls are available, no multipliers or complicated dependencies on other clocks, parents or children and no other users for this clock but the audio subsystem. I looked at the clock framework and couldn't figure out how it would simply map the hardware so for now the use of the MCLK is only enabled with an on/off or set-rate(19.2|25) custom API. I am not an expert here so if this clock framework becomes a requirement to upstream code I would appreciate any pointers to do the right thing. I really couldn't find a simple example with 'Put your code here' comments to use this framework.