From patchwork Tue Jan 24 04:37:33 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Lee X-Patchwork-Id: 137505 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 E7970B6EF3 for ; Tue, 24 Jan 2012 15:41:10 +1100 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1RpY9r-0004kg-QV; Tue, 24 Jan 2012 04:39:00 +0000 Received: from mail-gy0-f177.google.com ([209.85.160.177]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1RpY8l-0004Tx-5Z for linux-arm-kernel@lists.infradead.org; Tue, 24 Jan 2012 04:37:52 +0000 Received: by mail-gy0-f177.google.com with SMTP id z22so62381ghb.36 for ; Mon, 23 Jan 2012 20:37:51 -0800 (PST) MIME-Version: 1.0 Received: by 10.236.145.102 with SMTP id o66mr15338158yhj.28.1327379870972; Mon, 23 Jan 2012 20:37:50 -0800 (PST) Received: from b18647-20 ([23.19.172.97]) by mx.google.com with ESMTPS id h29sm14021831ann.16.2012.01.23.20.37.48 (version=SSLv3 cipher=OTHER); Mon, 23 Jan 2012 20:37:50 -0800 (PST) From: Robert Lee To: len.brown@intel.com, linux-pm@vger.kernel.org, s.hauer@pengutronix.de, amit.kucheria@linaro.org Subject: [PATCH v3 6/7] ARM: imx: Init imx5 gpc_dvfs clock for global use Date: Mon, 23 Jan 2012 22:37:33 -0600 Message-Id: <1327379854-12403-7-git-send-email-rob.lee@linaro.org> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1327379854-12403-1-git-send-email-rob.lee@linaro.org> References: <1327379854-12403-1-git-send-email-rob.lee@linaro.org> X-Gm-Message-State: ALoCoQndko2zFGosimwYGT+npRCaP+UWe/sSe/yF5EckKAj76n6/1itrnWAwrhjpk842fzMSvjn+ X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.160.177 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: khilman@ti.com, deepthi@linux.vnet.ibm.com, kgene.kim@samsung.com, linux@arm.linux.org.uk, patches@linaro.org, magnus.damm@gmail.com, daniel.lezcano@linaro.org, nicolas.ferre@atmel.com, nsekhar@ti.com, vincent.guittot@linaro.org, amit.kachhap@linaro.org, nicolas.pitre@linaro.org, broonie@opensource.wolfsonmicro.com, mturquette@linaro.org, arnd.bergmann@linaro.org, linux@maxim.org.za, shawn.guo@freescale.com, linux-arm-kernel@lists.infradead.org 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 The gpc_dvfs clock consumes practically zero power and must be enabled for various low power funcitonality. Now that a second user of this clock is being added (cpuidle) for mx5, it is cleanest to just enable this clock during clock initialization and leave it enabled. Signed-off-by: Robert Lee --- arch/arm/mach-mx5/clock-mx51-mx53.c | 3 +++ arch/arm/mach-mx5/pm-imx5.c | 24 ++---------------------- 2 files changed, 5 insertions(+), 22 deletions(-) diff --git a/arch/arm/mach-mx5/clock-mx51-mx53.c b/arch/arm/mach-mx5/clock-mx51-mx53.c index 4cb2769..12c8a2b 100644 --- a/arch/arm/mach-mx5/clock-mx51-mx53.c +++ b/arch/arm/mach-mx5/clock-mx51-mx53.c @@ -1533,6 +1533,7 @@ static struct clk_lookup mx53_lookups[] = { _REGISTER_CLOCK("imx53-ahci.0", "ahci", sata_clk) _REGISTER_CLOCK("imx53-ahci.0", "ahci_phy", ahci_phy_clk) _REGISTER_CLOCK("imx53-ahci.0", "ahci_dma", ahci_dma_clk) + _REGISTER_CLOCK(NULL, "gpc_dvfs", gpc_dvfs_clk) }; static void clk_tree_init(void) @@ -1572,6 +1573,7 @@ int __init mx51_clocks_init(unsigned long ckil, unsigned long osc, clk_enable(&cpu_clk); clk_enable(&main_bus_clk); + clk_enable(&gpc_dvfs_clk); clk_enable(&iim_clk); imx_print_silicon_rev("i.MX51", mx51_revision()); @@ -1615,6 +1617,7 @@ int __init mx53_clocks_init(unsigned long ckil, unsigned long osc, clk_set_parent(&uart_root_clk, &pll3_sw_clk); clk_enable(&cpu_clk); clk_enable(&main_bus_clk); + clk_enable(&gpc_dvfs_clk); clk_enable(&iim_clk); imx_print_silicon_rev("i.MX53", mx53_revision()); diff --git a/arch/arm/mach-mx5/pm-imx5.c b/arch/arm/mach-mx5/pm-imx5.c index 98052fc..36c5b57 100644 --- a/arch/arm/mach-mx5/pm-imx5.c +++ b/arch/arm/mach-mx5/pm-imx5.c @@ -18,13 +18,6 @@ #include #include "crm_regs.h" -static struct clk *gpc_dvfs_clk; - -static int mx5_suspend_prepare(void) -{ - return clk_enable(gpc_dvfs_clk); -} - static int mx5_suspend_enter(suspend_state_t state) { switch (state) { @@ -50,11 +43,6 @@ static int mx5_suspend_enter(suspend_state_t state) return 0; } -static void mx5_suspend_finish(void) -{ - clk_disable(gpc_dvfs_clk); -} - static int mx5_pm_valid(suspend_state_t state) { return (state > PM_SUSPEND_ON && state <= PM_SUSPEND_MAX); @@ -62,21 +50,13 @@ static int mx5_pm_valid(suspend_state_t state) static const struct platform_suspend_ops mx5_suspend_ops = { .valid = mx5_pm_valid, - .prepare = mx5_suspend_prepare, .enter = mx5_suspend_enter, - .finish = mx5_suspend_finish, }; static int __init mx5_pm_init(void) { - if (gpc_dvfs_clk == NULL) - gpc_dvfs_clk = clk_get(NULL, "gpc_dvfs"); - - if (!IS_ERR(gpc_dvfs_clk)) { - if (cpu_is_mx51()) - suspend_set_ops(&mx5_suspend_ops); - } else - return -EPERM; + if (cpu_is_mx51()) + suspend_set_ops(&mx5_suspend_ops); return 0; }