summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0012-OMAP2-cpufreq-dont-support-freq_table.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0012-OMAP2-cpufreq-dont-support-freq_table.patch')
-rw-r--r--recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0012-OMAP2-cpufreq-dont-support-freq_table.patch129
1 files changed, 0 insertions, 129 deletions
diff --git a/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0012-OMAP2-cpufreq-dont-support-freq_table.patch b/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0012-OMAP2-cpufreq-dont-support-freq_table.patch
deleted file mode 100644
index 33ffe54a..00000000
--- a/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0012-OMAP2-cpufreq-dont-support-freq_table.patch
+++ /dev/null
@@ -1,129 +0,0 @@
1From 407f4d9ed824d458406f139a7698c74a1eb3b8f7 Mon Sep 17 00:00:00 2001
2From: Nishanth Menon <nm@ti.com>
3Date: Thu, 26 May 2011 19:39:17 -0700
4Subject: [PATCH 12/19] OMAP2+: cpufreq: dont support !freq_table
5
6OMAP2+ all have frequency tables, hence the hacks we had for older
7silicon do not need to be carried forward. As part of this change,
8use cpufreq_frequency_table_target to find the best match for
9frequency requested.
10
11Signed-off-by: Nishanth Menon <nm@ti.com>
12Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
13---
14 arch/arm/mach-omap2/omap2plus-cpufreq.c | 67 +++++++++++++++----------------
15 1 files changed, 33 insertions(+), 34 deletions(-)
16
17diff --git a/arch/arm/mach-omap2/omap2plus-cpufreq.c b/arch/arm/mach-omap2/omap2plus-cpufreq.c
18index 33a91ec..acf18e8 100644
19--- a/arch/arm/mach-omap2/omap2plus-cpufreq.c
20+++ b/arch/arm/mach-omap2/omap2plus-cpufreq.c
21@@ -38,8 +38,6 @@
22
23 #include <mach/hardware.h>
24
25-#define VERY_HI_RATE 900000000
26-
27 static struct cpufreq_frequency_table *freq_table;
28 static struct clk *mpu_clk;
29 static char *mpu_clk_name;
30@@ -47,20 +45,9 @@ static struct device *mpu_dev;
31
32 static int omap_verify_speed(struct cpufreq_policy *policy)
33 {
34- if (freq_table)
35- return cpufreq_frequency_table_verify(policy, freq_table);
36-
37- if (policy->cpu)
38+ if (!freq_table)
39 return -EINVAL;
40-
41- cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq,
42- policy->cpuinfo.max_freq);
43-
44- policy->min = clk_round_rate(mpu_clk, policy->min * 1000) / 1000;
45- policy->max = clk_round_rate(mpu_clk, policy->max * 1000) / 1000;
46- cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq,
47- policy->cpuinfo.max_freq);
48- return 0;
49+ return cpufreq_frequency_table_verify(policy, freq_table);
50 }
51
52 static unsigned int omap_getspeed(unsigned int cpu)
53@@ -78,22 +65,35 @@ static int omap_target(struct cpufreq_policy *policy,
54 unsigned int target_freq,
55 unsigned int relation)
56 {
57- int i, ret = 0;
58+ unsigned int i;
59+ int ret = 0;
60 struct cpufreq_freqs freqs;
61
62 /* Changes not allowed until all CPUs are online */
63 if (is_smp() && (num_online_cpus() < NR_CPUS))
64 return ret;
65
66- /* Ensure desired rate is within allowed range. Some govenors
67- * (ondemand) will just pass target_freq=0 to get the minimum. */
68- if (target_freq < policy->min)
69- target_freq = policy->min;
70- if (target_freq > policy->max)
71- target_freq = policy->max;
72+ if (!freq_table) {
73+ dev_err(mpu_dev, "%s: cpu%d: no freq table!\n", __func__,
74+ policy->cpu);
75+ return -EINVAL;
76+ }
77+
78+ ret = cpufreq_frequency_table_target(policy, freq_table, target_freq,
79+ relation, &i);
80+ if (ret) {
81+ dev_dbg(mpu_dev, "%s: cpu%d: no freq match for %d(ret=%d)\n",
82+ __func__, policy->cpu, target_freq, ret);
83+ return ret;
84+ }
85+ freqs.new = freq_table[i].frequency;
86+ if (!freqs.new) {
87+ dev_err(mpu_dev, "%s: cpu%d: no match for freq %d\n", __func__,
88+ policy->cpu, target_freq);
89+ return -EINVAL;
90+ }
91
92 freqs.old = omap_getspeed(policy->cpu);
93- freqs.new = clk_round_rate(mpu_clk, target_freq * 1000) / 1000;
94 freqs.cpu = policy->cpu;
95
96 if (freqs.old == freqs.new)
97@@ -166,19 +166,18 @@ static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy)
98 return -EINVAL;
99
100 policy->cur = policy->min = policy->max = omap_getspeed(policy->cpu);
101- opp_init_cpufreq_table(mpu_dev, &freq_table);
102-
103- if (freq_table) {
104- result = cpufreq_frequency_table_cpuinfo(policy, freq_table);
105- if (!result)
106- cpufreq_frequency_table_get_attr(freq_table,
107- policy->cpu);
108- } else {
109- policy->cpuinfo.min_freq = clk_round_rate(mpu_clk, 0) / 1000;
110- policy->cpuinfo.max_freq = clk_round_rate(mpu_clk,
111- VERY_HI_RATE) / 1000;
112+ result = opp_init_cpufreq_table(mpu_dev, &freq_table);
113+
114+ if (result) {
115+ dev_err(mpu_dev, "%s: cpu%d: failed creating freq table[%d]\n",
116+ __func__, policy->cpu, result);
117+ return result;
118 }
119
120+ result = cpufreq_frequency_table_cpuinfo(policy, freq_table);
121+ if (!result)
122+ cpufreq_frequency_table_get_attr(freq_table, policy->cpu);
123+
124 policy->min = policy->cpuinfo.min_freq;
125 policy->max = policy->cpuinfo.max_freq;
126 policy->cur = omap_getspeed(policy->cpu);
127--
1281.7.2.5
129