From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Wu, Songjun" Subject: Re: [PATCH] ASoC: Atmel: ClassD: Set GCK's parent clock Date: Mon, 23 Nov 2015 11:01:54 +0800 Message-ID: <565281A2.4050500@atmel.com> References: <1447903590-3285-1-git-send-email-songjun.wu@atmel.com> <20151120180854.GD1929@sirena.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from DVREDG02.corp.atmel.com (nasmtp01.atmel.com [192.199.1.246]) by alsa0.perex.cz (Postfix) with ESMTP id C45BE265158 for ; Mon, 23 Nov 2015 04:02:10 +0100 (CET) In-Reply-To: <20151120180854.GD1929@sirena.org.uk> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Mark Brown Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Nicolas Ferre , Takashi Iwai , Liam Girdwood , linux-arm-kernel@lists.infradead.org List-Id: alsa-devel@alsa-project.org On 11/21/2015 02:08, Mark Brown wrote: > On Thu, Nov 19, 2015 at 11:26:30AM +0800, Songjun Wu wrote: >> Set GCK's parent clock as audio clock, make >> sure the GCK's parent clock is audio clock. > >> + ret = clk_set_parent(dd->gclk, dd->aclk); >> + if (ret) { >> + dev_err(dev, "failed to set GCK parent clock: %d\n", ret); >> + return ret; >> + } > > Why are we doing this in the driver? This should be done by whatever > creates the clock tree, not by the driver that uses the clocks - that > way if some future SoC has a different clock tree the driver will > continue to work. > You are right. The GCK's parent clock should be assigned in device tree, not in the driver. The DT binding for classD should be modified to set the GCK's parent clock as audio clock. Thank you. From mboxrd@z Thu Jan 1 00:00:00 1970 From: songjun.wu@atmel.com (Wu, Songjun) Date: Mon, 23 Nov 2015 11:01:54 +0800 Subject: [PATCH] ASoC: Atmel: ClassD: Set GCK's parent clock In-Reply-To: <20151120180854.GD1929@sirena.org.uk> References: <1447903590-3285-1-git-send-email-songjun.wu@atmel.com> <20151120180854.GD1929@sirena.org.uk> Message-ID: <565281A2.4050500@atmel.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 11/21/2015 02:08, Mark Brown wrote: > On Thu, Nov 19, 2015 at 11:26:30AM +0800, Songjun Wu wrote: >> Set GCK's parent clock as audio clock, make >> sure the GCK's parent clock is audio clock. > >> + ret = clk_set_parent(dd->gclk, dd->aclk); >> + if (ret) { >> + dev_err(dev, "failed to set GCK parent clock: %d\n", ret); >> + return ret; >> + } > > Why are we doing this in the driver? This should be done by whatever > creates the clock tree, not by the driver that uses the clocks - that > way if some future SoC has a different clock tree the driver will > continue to work. > You are right. The GCK's parent clock should be assigned in device tree, not in the driver. The DT binding for classD should be modified to set the GCK's parent clock as audio clock. Thank you. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753153AbbKWDCO (ORCPT ); Sun, 22 Nov 2015 22:02:14 -0500 Received: from nasmtp01.atmel.com ([192.199.1.246]:46909 "EHLO DVREDG02.corp.atmel.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752991AbbKWDCN (ORCPT ); Sun, 22 Nov 2015 22:02:13 -0500 Subject: Re: [PATCH] ASoC: Atmel: ClassD: Set GCK's parent clock To: Mark Brown References: <1447903590-3285-1-git-send-email-songjun.wu@atmel.com> <20151120180854.GD1929@sirena.org.uk> CC: , Nicolas Ferre , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , , From: "Wu, Songjun" Organization: ATMEL Message-ID: <565281A2.4050500@atmel.com> Date: Mon, 23 Nov 2015 11:01:54 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <20151120180854.GD1929@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 11/21/2015 02:08, Mark Brown wrote: > On Thu, Nov 19, 2015 at 11:26:30AM +0800, Songjun Wu wrote: >> Set GCK's parent clock as audio clock, make >> sure the GCK's parent clock is audio clock. > >> + ret = clk_set_parent(dd->gclk, dd->aclk); >> + if (ret) { >> + dev_err(dev, "failed to set GCK parent clock: %d\n", ret); >> + return ret; >> + } > > Why are we doing this in the driver? This should be done by whatever > creates the clock tree, not by the driver that uses the clocks - that > way if some future SoC has a different clock tree the driver will > continue to work. > You are right. The GCK's parent clock should be assigned in device tree, not in the driver. The DT binding for classD should be modified to set the GCK's parent clock as audio clock. Thank you.