From: rob.lee@linaro.org (Robert Lee)
To: linux-arm-kernel@lists.infradead.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 [thread overview]
Message-ID: <1327379854-12403-7-git-send-email-rob.lee@linaro.org> (raw)
In-Reply-To: <1327379854-12403-1-git-send-email-rob.lee@linaro.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 <rob.lee@linaro.org>
---
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 <mach/hardware.h>
#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;
}
--
1.7.1
next prev parent reply other threads:[~2012-01-24 4:37 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-24 4:37 [PATCH v3 0/7] Add common cpuidle code for consolidation Robert Lee
2012-01-24 4:37 ` [PATCH v3 1/7] cpuidle: Add common init interface and idle functionality Robert Lee
2012-01-24 14:36 ` Rob Herring
2012-01-24 22:43 ` Rob Lee
2012-01-24 20:16 ` Kevin Hilman
2012-01-24 23:10 ` Rob Lee
2012-01-24 23:46 ` Turquette, Mike
2012-01-25 2:03 ` Rob Lee
2012-01-24 23:49 ` Daniel Lezcano
2012-01-25 2:38 ` Rob Lee
2012-01-25 14:52 ` Daniel Lezcano
2012-01-24 4:37 ` [PATCH v3 2/7] ARM: exynos: Modify to use new common cpuidle code Robert Lee
2012-01-29 4:47 ` Barry Song
2012-01-24 4:37 ` [PATCH v3 3/7] ARM: shmobile: " Robert Lee
2012-01-24 4:37 ` [PATCH v3 4/7] ARM: kirkwood: " Robert Lee
2012-01-24 4:37 ` [PATCH v3 5/7] ARM: davinci: " Robert Lee
2012-01-24 4:37 ` Robert Lee [this message]
2012-01-24 4:37 ` [PATCH v3 7/7] ARM: imx: Add imx5 cpuidle implementation Robert Lee
2012-01-24 20:08 ` [PATCH v3 0/7] Add common cpuidle code for consolidation Kevin Hilman
2012-01-24 20:17 ` Mark Brown
2012-01-25 0:41 ` Kevin Hilman
2012-01-25 0:46 ` Rob Lee
2012-01-25 18:58 ` Kevin Hilman
2012-01-29 15:34 ` Russell King - ARM Linux
2012-01-31 3:02 ` Rob Lee
2012-01-31 21:55 ` Kevin Hilman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1327379854-12403-7-git-send-email-rob.lee@linaro.org \
--to=rob.lee@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).