diff options
Diffstat (limited to 'arch/arm/mach-mx3/dpm.c')
-rw-r--r-- | arch/arm/mach-mx3/dpm.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/arch/arm/mach-mx3/dpm.c b/arch/arm/mach-mx3/dpm.c index e05a6816c669..470708f6dd66 100644 --- a/arch/arm/mach-mx3/dpm.c +++ b/arch/arm/mach-mx3/dpm.c @@ -56,6 +56,10 @@ static unsigned saved_cpu_freq; static unsigned long saved_loops_per_jiffy; static unsigned int curr_mode = DPM_MODE_RUN; +static struct clk *cpu_clk; +static struct clk *ahb_clk; +static struct clk *ipg_clk; + extern void (*pm_idle) (void); static int mxc_dpm_set_opt(struct dpm_opt *cur, struct dpm_opt *new) @@ -221,10 +225,9 @@ static int mxc_dpm_get_opt(struct dpm_opt *opt) struct dpm_md_opt *md_opt; md_opt = &opt->md_opt; - - md_opt->cpu = mxc_get_clocks(CPU_CLK); - md_opt->ahb = mxc_get_clocks(AHB_CLK); - md_opt->ip = mxc_get_clocks(IPG_CLK); + md_opt->cpu = clk_get_rate(cpu_clk); + md_opt->ahb = clk_get_rate(ahb_clk); + md_opt->ip = clk_get_rate(ipg_clk); md_opt->mode = curr_mode; return 0; @@ -376,12 +379,9 @@ static void mxc_dpm_idle(void) static void mxc_dpm_startup(void) { - struct clk *clk; - if (!saved_loops_per_jiffy) { saved_loops_per_jiffy = loops_per_jiffy; - clk = clk_get(NULL, "cpu_clk"); - saved_cpu_freq = clk_get_rate(clk) / 1000; + saved_cpu_freq = clk_get_rate(cpu_clk) / 1000; } orig_idle = pm_idle; pm_idle = dpm_idle; @@ -396,6 +396,10 @@ static int __init mxc_dpm_init(void) { printk(KERN_INFO "Freescale i.MX31 Dynamic Power Management.\n"); + cpu_clk = clk_get(NULL, "cpu_clk"); + ahb_clk = clk_get(NULL, "ahb_clk"); + ipg_clk = clk_get(NULL, "ipg_clk"); + dpm_md.init_opt = mxc_dpm_init_opt; dpm_md.set_opt = mxc_dpm_set_opt; dpm_md.get_opt = mxc_dpm_get_opt; |