diff options
author | Marc Zyngier <maz@misterjones.org> | 2008-11-04 07:33:25 -0500 |
---|---|---|
committer | Eric Miao <eric.miao@marvell.com> | 2008-12-02 01:43:47 -0500 |
commit | 65587f7d154ac58f4ff100c240640c71abec41dd (patch) | |
tree | 19d83c0f8e67178a35182ba864683df091c3676c /arch/arm/mach-pxa/cpufreq-pxa2xx.c | |
parent | a5718a14a1d91b871e65d4e6b349e39c22cac943 (diff) |
[ARM] pxa: cpufreq-pxa2xx: allow frequency table selection
Following the removal of the "->policy" usage for PXA255 in patch
459fc208abd1b365fa013c17d433dfb5b4bc1e3a (cpufreq: remove
policy->governor setting in drivers initialization), this patch
introduces an option (called "pxa255_turbo_table") to select either
the "run" or "turbo" frequency table.
It also cures the runtime warning that was printed each time the
frequency was changed.
Got rid of all references to CPUFREQ_POLICY_* for pxa255, and sticked
with the run/turbo thing.
Tested on an Arcom/Eurotech Viper.
Signed-off-by: Marc Zyngier <maz@misterjones.org>
Acked-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Eric Miao <eric.miao@marvell.com>
Diffstat (limited to 'arch/arm/mach-pxa/cpufreq-pxa2xx.c')
-rw-r--r-- | arch/arm/mach-pxa/cpufreq-pxa2xx.c | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/arch/arm/mach-pxa/cpufreq-pxa2xx.c b/arch/arm/mach-pxa/cpufreq-pxa2xx.c index 1f272ea83f36..6bb678db537c 100644 --- a/arch/arm/mach-pxa/cpufreq-pxa2xx.c +++ b/arch/arm/mach-pxa/cpufreq-pxa2xx.c | |||
@@ -109,6 +109,10 @@ static struct cpufreq_frequency_table | |||
109 | static struct cpufreq_frequency_table | 109 | static struct cpufreq_frequency_table |
110 | pxa255_turbo_freq_table[NUM_PXA25x_TURBO_FREQS+1]; | 110 | pxa255_turbo_freq_table[NUM_PXA25x_TURBO_FREQS+1]; |
111 | 111 | ||
112 | static unsigned int pxa255_turbo_table; | ||
113 | module_param(pxa255_turbo_table, uint, 0); | ||
114 | MODULE_PARM_DESC(pxa255_turbo_table, "Selects the frequency table (0 = run table, !0 = turbo table)"); | ||
115 | |||
112 | /* | 116 | /* |
113 | * PXA270 definitions | 117 | * PXA270 definitions |
114 | * | 118 | * |
@@ -158,22 +162,16 @@ static struct cpufreq_frequency_table | |||
158 | 162 | ||
159 | extern unsigned get_clk_frequency_khz(int info); | 163 | extern unsigned get_clk_frequency_khz(int info); |
160 | 164 | ||
161 | static void find_freq_tables(struct cpufreq_policy *policy, | 165 | static void find_freq_tables(struct cpufreq_frequency_table **freq_table, |
162 | struct cpufreq_frequency_table **freq_table, | ||
163 | pxa_freqs_t **pxa_freqs) | 166 | pxa_freqs_t **pxa_freqs) |
164 | { | 167 | { |
165 | if (cpu_is_pxa25x()) { | 168 | if (cpu_is_pxa25x()) { |
166 | if (policy->policy == CPUFREQ_POLICY_PERFORMANCE) { | 169 | if (!pxa255_turbo_table) { |
167 | *pxa_freqs = pxa255_run_freqs; | 170 | *pxa_freqs = pxa255_run_freqs; |
168 | *freq_table = pxa255_run_freq_table; | 171 | *freq_table = pxa255_run_freq_table; |
169 | } else if (policy->policy == CPUFREQ_POLICY_POWERSAVE) { | 172 | } else { |
170 | *pxa_freqs = pxa255_turbo_freqs; | 173 | *pxa_freqs = pxa255_turbo_freqs; |
171 | *freq_table = pxa255_turbo_freq_table; | 174 | *freq_table = pxa255_turbo_freq_table; |
172 | } else { | ||
173 | printk("CPU PXA: Unknown policy found. " | ||
174 | "Using CPUFREQ_POLICY_PERFORMANCE\n"); | ||
175 | *pxa_freqs = pxa255_run_freqs; | ||
176 | *freq_table = pxa255_run_freq_table; | ||
177 | } | 175 | } |
178 | } | 176 | } |
179 | if (cpu_is_pxa27x()) { | 177 | if (cpu_is_pxa27x()) { |
@@ -212,7 +210,7 @@ static int pxa_verify_policy(struct cpufreq_policy *policy) | |||
212 | pxa_freqs_t *pxa_freqs; | 210 | pxa_freqs_t *pxa_freqs; |
213 | int ret; | 211 | int ret; |
214 | 212 | ||
215 | find_freq_tables(policy, &pxa_freqs_table, &pxa_freqs); | 213 | find_freq_tables(&pxa_freqs_table, &pxa_freqs); |
216 | ret = cpufreq_frequency_table_verify(policy, pxa_freqs_table); | 214 | ret = cpufreq_frequency_table_verify(policy, pxa_freqs_table); |
217 | 215 | ||
218 | if (freq_debug) | 216 | if (freq_debug) |
@@ -240,7 +238,7 @@ static int pxa_set_target(struct cpufreq_policy *policy, | |||
240 | unsigned int unused, preset_mdrefr, postset_mdrefr, cclkcfg; | 238 | unsigned int unused, preset_mdrefr, postset_mdrefr, cclkcfg; |
241 | 239 | ||
242 | /* Get the current policy */ | 240 | /* Get the current policy */ |
243 | find_freq_tables(policy, &pxa_freqs_table, &pxa_freq_settings); | 241 | find_freq_tables(&pxa_freqs_table, &pxa_freq_settings); |
244 | 242 | ||
245 | /* Lookup the next frequency */ | 243 | /* Lookup the next frequency */ |
246 | if (cpufreq_frequency_table_target(policy, pxa_freqs_table, | 244 | if (cpufreq_frequency_table_target(policy, pxa_freqs_table, |
@@ -329,6 +327,8 @@ static __init int pxa_cpufreq_init(struct cpufreq_policy *policy) | |||
329 | { | 327 | { |
330 | int i; | 328 | int i; |
331 | unsigned int freq; | 329 | unsigned int freq; |
330 | struct cpufreq_frequency_table *pxa255_freq_table; | ||
331 | pxa_freqs_t *pxa255_freqs; | ||
332 | 332 | ||
333 | /* try to guess pxa27x cpu */ | 333 | /* try to guess pxa27x cpu */ |
334 | if (cpu_is_pxa27x()) | 334 | if (cpu_is_pxa27x()) |
@@ -354,6 +354,8 @@ static __init int pxa_cpufreq_init(struct cpufreq_policy *policy) | |||
354 | } | 354 | } |
355 | pxa255_turbo_freq_table[i].frequency = CPUFREQ_TABLE_END; | 355 | pxa255_turbo_freq_table[i].frequency = CPUFREQ_TABLE_END; |
356 | 356 | ||
357 | pxa255_turbo_table = !!pxa255_turbo_table; | ||
358 | |||
357 | /* Generate the pxa27x cpufreq_frequency_table struct */ | 359 | /* Generate the pxa27x cpufreq_frequency_table struct */ |
358 | for (i = 0; i < NUM_PXA27x_FREQS; i++) { | 360 | for (i = 0; i < NUM_PXA27x_FREQS; i++) { |
359 | freq = pxa27x_freqs[i].khz; | 361 | freq = pxa27x_freqs[i].khz; |
@@ -368,8 +370,12 @@ static __init int pxa_cpufreq_init(struct cpufreq_policy *policy) | |||
368 | * Set the policy's minimum and maximum frequencies from the tables | 370 | * Set the policy's minimum and maximum frequencies from the tables |
369 | * just constructed. This sets cpuinfo.mxx_freq, min and max. | 371 | * just constructed. This sets cpuinfo.mxx_freq, min and max. |
370 | */ | 372 | */ |
371 | if (cpu_is_pxa25x()) | 373 | if (cpu_is_pxa25x()) { |
372 | cpufreq_frequency_table_cpuinfo(policy, pxa255_run_freq_table); | 374 | find_freq_tables(&pxa255_freq_table, &pxa255_freqs); |
375 | pr_info("PXA255 cpufreq using %s frequency table\n", | ||
376 | pxa255_turbo_table ? "turbo" : "run"); | ||
377 | cpufreq_frequency_table_cpuinfo(policy, pxa255_freq_table); | ||
378 | } | ||
373 | else if (cpu_is_pxa27x()) | 379 | else if (cpu_is_pxa27x()) |
374 | cpufreq_frequency_table_cpuinfo(policy, pxa27x_freq_table); | 380 | cpufreq_frequency_table_cpuinfo(policy, pxa27x_freq_table); |
375 | 381 | ||