From patchwork Thu Jan 19 02:18:53 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 136739 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E4294B6EEA for ; Thu, 19 Jan 2012 13:21:30 +1100 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Rnhae-00084m-E0; Thu, 19 Jan 2012 02:19:00 +0000 Received: from mail-pz0-f49.google.com ([209.85.210.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Rnhaa-00084Y-CE for linux-arm-kernel@lists.infradead.org; Thu, 19 Jan 2012 02:18:57 +0000 Received: by dadv40 with SMTP id v40so1524305dad.36 for ; Wed, 18 Jan 2012 18:18:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=wy9xTyNxyptAZyDcUCVCgNfKeAf/WmSX/KyT2V0nPng=; b=FFMq+jKjrUTQOqFCbvTfhFiIFy1QIriWM51NhmrY4fWTmPOrpTGxgaNQRV5hhq/IB5 YmfxpdoRfOn1QXIEh9D0GI6Wfpe+9OX9t0tPAiOrwhQQJ6EQ/TzbqwRmQ+NGLTJ2tJYy qm/MOhdc50KXQ2Wb6DZScHkd6OXug8RO97+y0= MIME-Version: 1.0 Received: by 10.68.191.3 with SMTP id gu3mr48067250pbc.112.1326939533946; Wed, 18 Jan 2012 18:18:53 -0800 (PST) Received: by 10.68.36.233 with HTTP; Wed, 18 Jan 2012 18:18:53 -0800 (PST) In-Reply-To: <20246.30805.391940.766120@ipc1.ka-ro> References: <1326820526-26498-1-git-send-email-fabio.estevam@freescale.com> <20246.30805.391940.766120@ipc1.ka-ro> Date: Thu, 19 Jan 2012 00:18:53 -0200 Message-ID: Subject: Re: [PATCH] ARM: mx28: Clear CLKGATE bit prior to changing DIV field From: Fabio Estevam To: =?UTF-8?Q?Lothar_Wa=C3=9Fmann?= X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.210.49 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (festevam[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Fabio Estevam , w.sang@pengutronix.de, marek.vasut@gmail.com, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de, shawn.guo@freescale.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org On Wed, Jan 18, 2012 at 5:44 AM, Lothar Waßmann wrote: > Now you are doing clk_enable()'s business in clk_set_rate(). > The same result could be achieved by calling clk_enable() prior to > clk_set_rate(). clk_set_rate() could simply return an error code, if > the clock is not enabled. Ok, understood. Your suggestion below works fine: I saw your comments about the need for clk_set_rate, so it looks like it is not safe to remove it. Can Lothar's suggestion be accepted? In your previous reply you seemed to prefer a solution at mxs-saif.c, but if we need to keep the clk_set_rate for saif, then we need the clk_prepare_enable for saif clk. I am a bit unsure of what your proposal is. Regards, Fabio Estevam diff --git a/arch/arm/mach-mxs/clock-mx28.c b/arch/arm/mach-mxs/clock-mx28.c index 5d68e41..c697b4a 100644 --- a/arch/arm/mach-mxs/clock-mx28.c +++ b/arch/arm/mach-mxs/clock-mx28.c @@ -809,6 +809,8 @@ int __init mx28_clocks_init(void) clk_prepare_enable(&xbus_clk); clk_prepare_enable(&emi_clk); clk_prepare_enable(&uart_clk); + clk_prepare_enable(&saif0_clk); + clk_prepare_enable(&saif1_clk); clk_set_parent(&lcdif_clk, &ref_pix_clk); clk_set_parent(&saif0_clk, &pll0_clk); Or also the patch below instead: --- a/arch/arm/mach-mxs/clock-mx28.c +++ b/arch/arm/mach-mxs/clock-mx28.c @@ -814,15 +814,6 @@ int __init mx28_clocks_init(void) clk_set_parent(&saif0_clk, &pll0_clk); clk_set_parent(&saif1_clk, &pll0_clk); - /* - * Set an initial clock rate for the saif internal logic to work - * properly. This is important when working in EXTMASTER mode that - * uses the other saif's BITCLK&LRCLK but it still needs a basic - * clock which should be fast enough for the internal logic. - */ - clk_set_rate(&saif0_clk, 24000000); - clk_set_rate(&saif1_clk, 24000000); - clkdev_add_table(lookups, ARRAY_SIZE(lookups)); --- Shawn,