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>
This commit is contained in:
parent
022ac03b45
commit
08ca3e3b8d
1 changed files with 13 additions and 7 deletions
|
@ -49,6 +49,7 @@ static struct lpj_info global_lpj_ref;
|
||||||
|
|
||||||
static struct cpufreq_frequency_table *freq_table;
|
static struct cpufreq_frequency_table *freq_table;
|
||||||
static struct clk *mpu_clk;
|
static struct clk *mpu_clk;
|
||||||
|
static char *mpu_clk_name;
|
||||||
|
|
||||||
static int omap_verify_speed(struct cpufreq_policy *policy)
|
static int omap_verify_speed(struct cpufreq_policy *policy)
|
||||||
{
|
{
|
||||||
|
@ -153,13 +154,7 @@ static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy)
|
||||||
int result = 0;
|
int result = 0;
|
||||||
struct device *mpu_dev;
|
struct device *mpu_dev;
|
||||||
|
|
||||||
if (cpu_is_omap24xx())
|
mpu_clk = clk_get(NULL, mpu_clk_name);
|
||||||
mpu_clk = clk_get(NULL, "virt_prcm_set");
|
|
||||||
else if (cpu_is_omap34xx())
|
|
||||||
mpu_clk = clk_get(NULL, "dpll1_ck");
|
|
||||||
else if (cpu_is_omap44xx())
|
|
||||||
mpu_clk = clk_get(NULL, "dpll_mpu_ck");
|
|
||||||
|
|
||||||
if (IS_ERR(mpu_clk))
|
if (IS_ERR(mpu_clk))
|
||||||
return PTR_ERR(mpu_clk);
|
return PTR_ERR(mpu_clk);
|
||||||
|
|
||||||
|
@ -233,6 +228,17 @@ static struct cpufreq_driver omap_driver = {
|
||||||
|
|
||||||
static int __init omap_cpufreq_init(void)
|
static int __init omap_cpufreq_init(void)
|
||||||
{
|
{
|
||||||
|
if (cpu_is_omap24xx())
|
||||||
|
mpu_clk_name = "virt_prcm_set";
|
||||||
|
else if (cpu_is_omap34xx())
|
||||||
|
mpu_clk_name = "dpll1_ck";
|
||||||
|
else if (cpu_is_omap44xx())
|
||||||
|
mpu_clk_name = "dpll_mpu_ck";
|
||||||
|
|
||||||
|
if (!mpu_clk_name) {
|
||||||
|
pr_err("%s: unsupported Silicon?\n", __func__);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
return cpufreq_register_driver(&omap_driver);
|
return cpufreq_register_driver(&omap_driver);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue