diff options
Diffstat (limited to 'arch/ia64')
-rw-r--r-- | arch/ia64/kernel/cpufreq/acpi-cpufreq.c | 44 |
1 files changed, 21 insertions, 23 deletions
diff --git a/arch/ia64/kernel/cpufreq/acpi-cpufreq.c b/arch/ia64/kernel/cpufreq/acpi-cpufreq.c index 22f61526a8e1..f09b174244d5 100644 --- a/arch/ia64/kernel/cpufreq/acpi-cpufreq.c +++ b/arch/ia64/kernel/cpufreq/acpi-cpufreq.c | |||
@@ -23,8 +23,6 @@ | |||
23 | #include <linux/acpi.h> | 23 | #include <linux/acpi.h> |
24 | #include <acpi/processor.h> | 24 | #include <acpi/processor.h> |
25 | 25 | ||
26 | #define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "acpi-cpufreq", msg) | ||
27 | |||
28 | MODULE_AUTHOR("Venkatesh Pallipadi"); | 26 | MODULE_AUTHOR("Venkatesh Pallipadi"); |
29 | MODULE_DESCRIPTION("ACPI Processor P-States Driver"); | 27 | MODULE_DESCRIPTION("ACPI Processor P-States Driver"); |
30 | MODULE_LICENSE("GPL"); | 28 | MODULE_LICENSE("GPL"); |
@@ -47,12 +45,12 @@ processor_set_pstate ( | |||
47 | { | 45 | { |
48 | s64 retval; | 46 | s64 retval; |
49 | 47 | ||
50 | dprintk("processor_set_pstate\n"); | 48 | pr_debug("processor_set_pstate\n"); |
51 | 49 | ||
52 | retval = ia64_pal_set_pstate((u64)value); | 50 | retval = ia64_pal_set_pstate((u64)value); |
53 | 51 | ||
54 | if (retval) { | 52 | if (retval) { |
55 | dprintk("Failed to set freq to 0x%x, with error 0x%lx\n", | 53 | pr_debug("Failed to set freq to 0x%x, with error 0x%lx\n", |
56 | value, retval); | 54 | value, retval); |
57 | return -ENODEV; | 55 | return -ENODEV; |
58 | } | 56 | } |
@@ -67,14 +65,14 @@ processor_get_pstate ( | |||
67 | u64 pstate_index = 0; | 65 | u64 pstate_index = 0; |
68 | s64 retval; | 66 | s64 retval; |
69 | 67 | ||
70 | dprintk("processor_get_pstate\n"); | 68 | pr_debug("processor_get_pstate\n"); |
71 | 69 | ||
72 | retval = ia64_pal_get_pstate(&pstate_index, | 70 | retval = ia64_pal_get_pstate(&pstate_index, |
73 | PAL_GET_PSTATE_TYPE_INSTANT); | 71 | PAL_GET_PSTATE_TYPE_INSTANT); |
74 | *value = (u32) pstate_index; | 72 | *value = (u32) pstate_index; |
75 | 73 | ||
76 | if (retval) | 74 | if (retval) |
77 | dprintk("Failed to get current freq with " | 75 | pr_debug("Failed to get current freq with " |
78 | "error 0x%lx, idx 0x%x\n", retval, *value); | 76 | "error 0x%lx, idx 0x%x\n", retval, *value); |
79 | 77 | ||
80 | return (int)retval; | 78 | return (int)retval; |
@@ -90,7 +88,7 @@ extract_clock ( | |||
90 | { | 88 | { |
91 | unsigned long i; | 89 | unsigned long i; |
92 | 90 | ||
93 | dprintk("extract_clock\n"); | 91 | pr_debug("extract_clock\n"); |
94 | 92 | ||
95 | for (i = 0; i < data->acpi_data.state_count; i++) { | 93 | for (i = 0; i < data->acpi_data.state_count; i++) { |
96 | if (value == data->acpi_data.states[i].status) | 94 | if (value == data->acpi_data.states[i].status) |
@@ -110,7 +108,7 @@ processor_get_freq ( | |||
110 | cpumask_t saved_mask; | 108 | cpumask_t saved_mask; |
111 | unsigned long clock_freq; | 109 | unsigned long clock_freq; |
112 | 110 | ||
113 | dprintk("processor_get_freq\n"); | 111 | pr_debug("processor_get_freq\n"); |
114 | 112 | ||
115 | saved_mask = current->cpus_allowed; | 113 | saved_mask = current->cpus_allowed; |
116 | set_cpus_allowed_ptr(current, cpumask_of(cpu)); | 114 | set_cpus_allowed_ptr(current, cpumask_of(cpu)); |
@@ -148,7 +146,7 @@ processor_set_freq ( | |||
148 | cpumask_t saved_mask; | 146 | cpumask_t saved_mask; |
149 | int retval; | 147 | int retval; |
150 | 148 | ||
151 | dprintk("processor_set_freq\n"); | 149 | pr_debug("processor_set_freq\n"); |
152 | 150 | ||
153 | saved_mask = current->cpus_allowed; | 151 | saved_mask = current->cpus_allowed; |
154 | set_cpus_allowed_ptr(current, cpumask_of(cpu)); | 152 | set_cpus_allowed_ptr(current, cpumask_of(cpu)); |
@@ -159,16 +157,16 @@ processor_set_freq ( | |||
159 | 157 | ||
160 | if (state == data->acpi_data.state) { | 158 | if (state == data->acpi_data.state) { |
161 | if (unlikely(data->resume)) { | 159 | if (unlikely(data->resume)) { |
162 | dprintk("Called after resume, resetting to P%d\n", state); | 160 | pr_debug("Called after resume, resetting to P%d\n", state); |
163 | data->resume = 0; | 161 | data->resume = 0; |
164 | } else { | 162 | } else { |
165 | dprintk("Already at target state (P%d)\n", state); | 163 | pr_debug("Already at target state (P%d)\n", state); |
166 | retval = 0; | 164 | retval = 0; |
167 | goto migrate_end; | 165 | goto migrate_end; |
168 | } | 166 | } |
169 | } | 167 | } |
170 | 168 | ||
171 | dprintk("Transitioning from P%d to P%d\n", | 169 | pr_debug("Transitioning from P%d to P%d\n", |
172 | data->acpi_data.state, state); | 170 | data->acpi_data.state, state); |
173 | 171 | ||
174 | /* cpufreq frequency struct */ | 172 | /* cpufreq frequency struct */ |
@@ -186,7 +184,7 @@ processor_set_freq ( | |||
186 | 184 | ||
187 | value = (u32) data->acpi_data.states[state].control; | 185 | value = (u32) data->acpi_data.states[state].control; |
188 | 186 | ||
189 | dprintk("Transitioning to state: 0x%08x\n", value); | 187 | pr_debug("Transitioning to state: 0x%08x\n", value); |
190 | 188 | ||
191 | ret = processor_set_pstate(value); | 189 | ret = processor_set_pstate(value); |
192 | if (ret) { | 190 | if (ret) { |
@@ -219,7 +217,7 @@ acpi_cpufreq_get ( | |||
219 | { | 217 | { |
220 | struct cpufreq_acpi_io *data = acpi_io_data[cpu]; | 218 | struct cpufreq_acpi_io *data = acpi_io_data[cpu]; |
221 | 219 | ||
222 | dprintk("acpi_cpufreq_get\n"); | 220 | pr_debug("acpi_cpufreq_get\n"); |
223 | 221 | ||
224 | return processor_get_freq(data, cpu); | 222 | return processor_get_freq(data, cpu); |
225 | } | 223 | } |
@@ -235,7 +233,7 @@ acpi_cpufreq_target ( | |||
235 | unsigned int next_state = 0; | 233 | unsigned int next_state = 0; |
236 | unsigned int result = 0; | 234 | unsigned int result = 0; |
237 | 235 | ||
238 | dprintk("acpi_cpufreq_setpolicy\n"); | 236 | pr_debug("acpi_cpufreq_setpolicy\n"); |
239 | 237 | ||
240 | result = cpufreq_frequency_table_target(policy, | 238 | result = cpufreq_frequency_table_target(policy, |
241 | data->freq_table, target_freq, relation, &next_state); | 239 | data->freq_table, target_freq, relation, &next_state); |
@@ -255,7 +253,7 @@ acpi_cpufreq_verify ( | |||
255 | unsigned int result = 0; | 253 | unsigned int result = 0; |
256 | struct cpufreq_acpi_io *data = acpi_io_data[policy->cpu]; | 254 | struct cpufreq_acpi_io *data = acpi_io_data[policy->cpu]; |
257 | 255 | ||
258 | dprintk("acpi_cpufreq_verify\n"); | 256 | pr_debug("acpi_cpufreq_verify\n"); |
259 | 257 | ||
260 | result = cpufreq_frequency_table_verify(policy, | 258 | result = cpufreq_frequency_table_verify(policy, |
261 | data->freq_table); | 259 | data->freq_table); |
@@ -273,7 +271,7 @@ acpi_cpufreq_cpu_init ( | |||
273 | struct cpufreq_acpi_io *data; | 271 | struct cpufreq_acpi_io *data; |
274 | unsigned int result = 0; | 272 | unsigned int result = 0; |
275 | 273 | ||
276 | dprintk("acpi_cpufreq_cpu_init\n"); | 274 | pr_debug("acpi_cpufreq_cpu_init\n"); |
277 | 275 | ||
278 | data = kzalloc(sizeof(struct cpufreq_acpi_io), GFP_KERNEL); | 276 | data = kzalloc(sizeof(struct cpufreq_acpi_io), GFP_KERNEL); |
279 | if (!data) | 277 | if (!data) |
@@ -288,7 +286,7 @@ acpi_cpufreq_cpu_init ( | |||
288 | 286 | ||
289 | /* capability check */ | 287 | /* capability check */ |
290 | if (data->acpi_data.state_count <= 1) { | 288 | if (data->acpi_data.state_count <= 1) { |
291 | dprintk("No P-States\n"); | 289 | pr_debug("No P-States\n"); |
292 | result = -ENODEV; | 290 | result = -ENODEV; |
293 | goto err_unreg; | 291 | goto err_unreg; |
294 | } | 292 | } |
@@ -297,7 +295,7 @@ acpi_cpufreq_cpu_init ( | |||
297 | ACPI_ADR_SPACE_FIXED_HARDWARE) || | 295 | ACPI_ADR_SPACE_FIXED_HARDWARE) || |
298 | (data->acpi_data.status_register.space_id != | 296 | (data->acpi_data.status_register.space_id != |
299 | ACPI_ADR_SPACE_FIXED_HARDWARE)) { | 297 | ACPI_ADR_SPACE_FIXED_HARDWARE)) { |
300 | dprintk("Unsupported address space [%d, %d]\n", | 298 | pr_debug("Unsupported address space [%d, %d]\n", |
301 | (u32) (data->acpi_data.control_register.space_id), | 299 | (u32) (data->acpi_data.control_register.space_id), |
302 | (u32) (data->acpi_data.status_register.space_id)); | 300 | (u32) (data->acpi_data.status_register.space_id)); |
303 | result = -ENODEV; | 301 | result = -ENODEV; |
@@ -348,7 +346,7 @@ acpi_cpufreq_cpu_init ( | |||
348 | "activated.\n", cpu); | 346 | "activated.\n", cpu); |
349 | 347 | ||
350 | for (i = 0; i < data->acpi_data.state_count; i++) | 348 | for (i = 0; i < data->acpi_data.state_count; i++) |
351 | dprintk(" %cP%d: %d MHz, %d mW, %d uS, %d uS, 0x%x 0x%x\n", | 349 | pr_debug(" %cP%d: %d MHz, %d mW, %d uS, %d uS, 0x%x 0x%x\n", |
352 | (i == data->acpi_data.state?'*':' '), i, | 350 | (i == data->acpi_data.state?'*':' '), i, |
353 | (u32) data->acpi_data.states[i].core_frequency, | 351 | (u32) data->acpi_data.states[i].core_frequency, |
354 | (u32) data->acpi_data.states[i].power, | 352 | (u32) data->acpi_data.states[i].power, |
@@ -383,7 +381,7 @@ acpi_cpufreq_cpu_exit ( | |||
383 | { | 381 | { |
384 | struct cpufreq_acpi_io *data = acpi_io_data[policy->cpu]; | 382 | struct cpufreq_acpi_io *data = acpi_io_data[policy->cpu]; |
385 | 383 | ||
386 | dprintk("acpi_cpufreq_cpu_exit\n"); | 384 | pr_debug("acpi_cpufreq_cpu_exit\n"); |
387 | 385 | ||
388 | if (data) { | 386 | if (data) { |
389 | cpufreq_frequency_table_put_attr(policy->cpu); | 387 | cpufreq_frequency_table_put_attr(policy->cpu); |
@@ -418,7 +416,7 @@ static struct cpufreq_driver acpi_cpufreq_driver = { | |||
418 | static int __init | 416 | static int __init |
419 | acpi_cpufreq_init (void) | 417 | acpi_cpufreq_init (void) |
420 | { | 418 | { |
421 | dprintk("acpi_cpufreq_init\n"); | 419 | pr_debug("acpi_cpufreq_init\n"); |
422 | 420 | ||
423 | return cpufreq_register_driver(&acpi_cpufreq_driver); | 421 | return cpufreq_register_driver(&acpi_cpufreq_driver); |
424 | } | 422 | } |
@@ -427,7 +425,7 @@ acpi_cpufreq_init (void) | |||
427 | static void __exit | 425 | static void __exit |
428 | acpi_cpufreq_exit (void) | 426 | acpi_cpufreq_exit (void) |
429 | { | 427 | { |
430 | dprintk("acpi_cpufreq_exit\n"); | 428 | pr_debug("acpi_cpufreq_exit\n"); |
431 | 429 | ||
432 | cpufreq_unregister_driver(&acpi_cpufreq_driver); | 430 | cpufreq_unregister_driver(&acpi_cpufreq_driver); |
433 | return; | 431 | return; |