Arm: tegra: Remove emc clock client for cpu
Puneet Saxena [Fri, 19 Jul 2013 15:16:19 +0000 (20:16 +0530)]
It removes emc clock client created for scaling emc freq
due to cpu to emc static coupling.ratio.

Now emc scaling due to cpu request is taken care by
MCCPU actmon device.

Bug 1338326

Change-Id: I320d37396a773102ecd7fdfa1934834db9bf34df
Signed-off-by: Puneet Saxena <puneets@nvidia.com>
Reviewed-on: http://git-master/r/244778
(cherry picked from commit 26688f560926a8afd8d44364e79aa84143065979)
Reviewed-on: http://git-master/r/278897
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Tested-by: Sachin Nikam <snikam@nvidia.com>
(cherry picked from commit be31933caee68a5b47559513564b9b7dc1844350)
Signed-off-by: Ajay Nandakumar <anandakumarm@nvidia.com>

arch/arm/mach-tegra/clock.h
arch/arm/mach-tegra/cpu-tegra.c

index f2b4bfa..45a9a56 100644 (file)
@@ -476,6 +476,9 @@ static inline int tegra_update_mselect_rate(unsigned long cpu_rate)
 #else
 int tegra_update_mselect_rate(unsigned long cpu_rate);
 #endif
+#else
+static inline unsigned long tegra_emc_to_cpu_ratio(unsigned long cpu_rate)
+{ return 0; }
 #endif
 
 #endif
index 854f347..ddee440 100644 (file)
@@ -45,7 +45,6 @@
 static struct cpufreq_frequency_table *freq_table;
 
 static struct clk *cpu_clk;
-static struct clk *emc_clk;
 
 static unsigned long policy_max_speed[CONFIG_NR_CPUS];
 static unsigned long target_cpu_speed[CONFIG_NR_CPUS];
@@ -530,12 +529,6 @@ int tegra_update_cpu_speed(unsigned long rate)
                               " frequency %u kHz\n", freqs.new);
                        return ret;
                }
-               ret = clk_set_rate(emc_clk, tegra_emc_to_cpu_ratio(freqs.new));
-               if (ret) {
-                       pr_err("cpu-tegra: Failed to scale emc for cpu"
-                              " frequency %u kHz\n", freqs.new);
-                       return ret;
-               }
        }
 
        for_each_online_cpu(freqs.cpu)
@@ -556,10 +549,8 @@ int tegra_update_cpu_speed(unsigned long rate)
        for_each_online_cpu(freqs.cpu)
                cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
 
-       if (freqs.old > freqs.new) {
-               clk_set_rate(emc_clk, tegra_emc_to_cpu_ratio(freqs.new));
+       if (freqs.old > freqs.new)
                tegra_update_mselect_rate(freqs.new);
-       }
 
        return 0;
 }
@@ -749,13 +740,6 @@ static int tegra_cpu_init(struct cpufreq_policy *policy)
        if (IS_ERR(cpu_clk))
                return PTR_ERR(cpu_clk);
 
-       emc_clk = clk_get_sys("cpu", "emc");
-       if (IS_ERR(emc_clk)) {
-               clk_put(cpu_clk);
-               return PTR_ERR(emc_clk);
-       }
-
-       clk_prepare_enable(emc_clk);
        clk_prepare_enable(cpu_clk);
 
        cpufreq_frequency_table_cpuinfo(policy, freq_table);
@@ -784,8 +768,6 @@ static int tegra_cpu_init(struct cpufreq_policy *policy)
 static int tegra_cpu_exit(struct cpufreq_policy *policy)
 {
        cpufreq_frequency_table_cpuinfo(policy, freq_table);
-       clk_disable_unprepare(emc_clk);
-       clk_put(emc_clk);
        clk_put(cpu_clk);
        return 0;
 }