From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753472AbbBDDqb (ORCPT ); Tue, 3 Feb 2015 22:46:31 -0500 Received: from eusmtp01.atmel.com ([212.144.249.242]:44085 "EHLO eusmtp01.atmel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751573AbbBDDq2 (ORCPT ); Tue, 3 Feb 2015 22:46:28 -0500 Message-ID: <54D195D9.4090101@atmel.com> Date: Wed, 4 Feb 2015 11:45:29 +0800 From: Bo Shen User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Mark Brown , Manuel Lauss CC: Manuel Lauss , Liam Girdwood , Richard Purdie , , , alsa-devel , , LKML Subject: Re: [RFC PATCH] ASoC: wm8731: let codec to manage clock by itself References: <1422934415-24957-1-git-send-email-voice.shen@atmel.com> <20150203124441.GK21293@sirena.org.uk> <20150203162128.GP21293@sirena.org.uk> In-Reply-To: <20150203162128.GP21293@sirena.org.uk> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.168.5.13] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Mark, On 02/04/2015 12:21 AM, Mark Brown wrote: > On Tue, Feb 03, 2015 at 03:40:45PM +0100, Manuel Lauss wrote: >> On Tue, Feb 3, 2015 at 1:44 PM, Mark Brown wrote: > >>>> + wm8731->mclk = devm_clk_get(&spi->dev, "mclk"); >>>> + if (IS_ERR(wm8731->mclk)) { >>>> + wm8731->mclk = NULL; >>>> + dev_warn(&spi->dev, "assuming static MCLK\n"); >>>> + } > >>> This is broken for both deferred probe and in the case where the clock >>> API genuinely returns a NULL clock. Other than that it's the kind of >>> thing that we've done for some other drivers, though it's not good to >>> have to do this. Check them for correct behaviour. > >> Hm, so the only option is to create the simples possible 12MHz clk object? > > Well, that's the best option in general. You can get away with just > making sure that -EPROBE_DEFER is handled and that IS_ERR() is used to > check for an invalid clock but if you can define a clock that's even > better (and should be pretty painless), we're going to want to do that > transition at some point. Do you mean I send my RFC patch as the formal patch, and let other boards which use the wm8731 to add clk object, am I right? Best Regards, Bo Shen