diff options
Diffstat (limited to 'arch/arm/mach-tegra/cpu-tegra.c')
| -rw-r--r-- | arch/arm/mach-tegra/cpu-tegra.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/arch/arm/mach-tegra/cpu-tegra.c b/arch/arm/mach-tegra/cpu-tegra.c index e3d6e15ff188..11ca730970f8 100644 --- a/arch/arm/mach-tegra/cpu-tegra.c +++ b/arch/arm/mach-tegra/cpu-tegra.c | |||
| @@ -106,7 +106,8 @@ out: | |||
| 106 | return ret; | 106 | return ret; |
| 107 | } | 107 | } |
| 108 | 108 | ||
| 109 | static int tegra_update_cpu_speed(unsigned long rate) | 109 | static int tegra_update_cpu_speed(struct cpufreq_policy *policy, |
| 110 | unsigned long rate) | ||
| 110 | { | 111 | { |
| 111 | int ret = 0; | 112 | int ret = 0; |
| 112 | struct cpufreq_freqs freqs; | 113 | struct cpufreq_freqs freqs; |
| @@ -128,8 +129,7 @@ static int tegra_update_cpu_speed(unsigned long rate) | |||
| 128 | else | 129 | else |
| 129 | clk_set_rate(emc_clk, 100000000); /* emc 50Mhz */ | 130 | clk_set_rate(emc_clk, 100000000); /* emc 50Mhz */ |
| 130 | 131 | ||
| 131 | for_each_online_cpu(freqs.cpu) | 132 | cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); |
| 132 | cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); | ||
| 133 | 133 | ||
| 134 | #ifdef CONFIG_CPU_FREQ_DEBUG | 134 | #ifdef CONFIG_CPU_FREQ_DEBUG |
| 135 | printk(KERN_DEBUG "cpufreq-tegra: transition: %u --> %u\n", | 135 | printk(KERN_DEBUG "cpufreq-tegra: transition: %u --> %u\n", |
| @@ -143,8 +143,7 @@ static int tegra_update_cpu_speed(unsigned long rate) | |||
| 143 | return ret; | 143 | return ret; |
| 144 | } | 144 | } |
| 145 | 145 | ||
| 146 | for_each_online_cpu(freqs.cpu) | 146 | cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); |
| 147 | cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); | ||
| 148 | 147 | ||
| 149 | return 0; | 148 | return 0; |
| 150 | } | 149 | } |
| @@ -181,7 +180,7 @@ static int tegra_target(struct cpufreq_policy *policy, | |||
| 181 | 180 | ||
| 182 | target_cpu_speed[policy->cpu] = freq; | 181 | target_cpu_speed[policy->cpu] = freq; |
| 183 | 182 | ||
| 184 | ret = tegra_update_cpu_speed(tegra_cpu_highest_speed()); | 183 | ret = tegra_update_cpu_speed(policy, tegra_cpu_highest_speed()); |
| 185 | 184 | ||
| 186 | out: | 185 | out: |
| 187 | mutex_unlock(&tegra_cpu_lock); | 186 | mutex_unlock(&tegra_cpu_lock); |
| @@ -193,10 +192,12 @@ static int tegra_pm_notify(struct notifier_block *nb, unsigned long event, | |||
| 193 | { | 192 | { |
| 194 | mutex_lock(&tegra_cpu_lock); | 193 | mutex_lock(&tegra_cpu_lock); |
| 195 | if (event == PM_SUSPEND_PREPARE) { | 194 | if (event == PM_SUSPEND_PREPARE) { |
| 195 | struct cpufreq_policy *policy = cpufreq_cpu_get(0); | ||
| 196 | is_suspended = true; | 196 | is_suspended = true; |
| 197 | pr_info("Tegra cpufreq suspend: setting frequency to %d kHz\n", | 197 | pr_info("Tegra cpufreq suspend: setting frequency to %d kHz\n", |
| 198 | freq_table[0].frequency); | 198 | freq_table[0].frequency); |
| 199 | tegra_update_cpu_speed(freq_table[0].frequency); | 199 | tegra_update_cpu_speed(policy, freq_table[0].frequency); |
| 200 | cpufreq_cpu_put(policy); | ||
| 200 | } else if (event == PM_POST_SUSPEND) { | 201 | } else if (event == PM_POST_SUSPEND) { |
| 201 | is_suspended = false; | 202 | is_suspended = false; |
| 202 | } | 203 | } |
