Commit 1326fa4b315709c408b7690a926dfa8f53671eda

Authored by Nishanth Menon
Committed by Afzal Mohammed
1 parent 15e2c6f076
Exists in master

cpufreq: OMAP: move clk name decision to init

Clk name does'nt need to dynamically detected during clk init.
move them off to driver initialization, if we dont have a clk name,
there is no point in registering the driver anyways. The actual clk
get and put is left at cpu_init and exit functions.

Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
[vaibhav.bedia@ti.com: Pull in for AM33xx]
Signed-off-by: Vaibhav Bedia <vaibhav.bedia@ti.com>

Showing 1 changed file with 13 additions and 7 deletions Side-by-side Diff

drivers/cpufreq/omap-cpufreq.c
... ... @@ -49,6 +49,7 @@
49 49  
50 50 static struct cpufreq_frequency_table *freq_table;
51 51 static struct clk *mpu_clk;
  52 +static char *mpu_clk_name;
52 53  
53 54 static int omap_verify_speed(struct cpufreq_policy *policy)
54 55 {
... ... @@ -153,13 +154,7 @@
153 154 int result = 0;
154 155 struct device *mpu_dev;
155 156  
156   - if (cpu_is_omap24xx())
157   - mpu_clk = clk_get(NULL, "virt_prcm_set");
158   - else if (cpu_is_omap34xx())
159   - mpu_clk = clk_get(NULL, "dpll1_ck");
160   - else if (cpu_is_omap44xx())
161   - mpu_clk = clk_get(NULL, "dpll_mpu_ck");
162   -
  157 + mpu_clk = clk_get(NULL, mpu_clk_name);
163 158 if (IS_ERR(mpu_clk))
164 159 return PTR_ERR(mpu_clk);
165 160  
... ... @@ -233,6 +228,17 @@
233 228  
234 229 static int __init omap_cpufreq_init(void)
235 230 {
  231 + if (cpu_is_omap24xx())
  232 + mpu_clk_name = "virt_prcm_set";
  233 + else if (cpu_is_omap34xx())
  234 + mpu_clk_name = "dpll1_ck";
  235 + else if (cpu_is_omap44xx())
  236 + mpu_clk_name = "dpll_mpu_ck";
  237 +
  238 + if (!mpu_clk_name) {
  239 + pr_err("%s: unsupported Silicon?\n", __func__);
  240 + return -EINVAL;
  241 + }
236 242 return cpufreq_register_driver(&omap_driver);
237 243 }
238 244