diff options
author | Corentin LABBE <clabbe.montjoie@gmail.com> | 2018-01-18 15:02:02 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2018-02-07 05:44:23 -0500 |
commit | 3d70671667f15f4bae260541cd91330ef20d2f2e (patch) | |
tree | ac8b3a2b6cf6a23ac96e2132e93a03ea2594044f | |
parent | 59a3b3a8db16621574cbac69f6f1eddb9c60e821 (diff) |
cpufreq: remove at32ap-cpufreq
Since AVR32 arch was removed, at32ap-cpufreq is useless.
Remove this driver.
Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r-- | drivers/cpufreq/Kconfig | 10 | ||||
-rw-r--r-- | drivers/cpufreq/Makefile | 1 | ||||
-rw-r--r-- | drivers/cpufreq/at32ap-cpufreq.c | 127 |
3 files changed, 0 insertions, 138 deletions
diff --git a/drivers/cpufreq/Kconfig b/drivers/cpufreq/Kconfig index d8addbce40bc..608af20a3494 100644 --- a/drivers/cpufreq/Kconfig +++ b/drivers/cpufreq/Kconfig | |||
@@ -239,16 +239,6 @@ if PPC32 || PPC64 | |||
239 | source "drivers/cpufreq/Kconfig.powerpc" | 239 | source "drivers/cpufreq/Kconfig.powerpc" |
240 | endif | 240 | endif |
241 | 241 | ||
242 | if AVR32 | ||
243 | config AVR32_AT32AP_CPUFREQ | ||
244 | bool "CPU frequency driver for AT32AP" | ||
245 | depends on PLATFORM_AT32AP | ||
246 | default n | ||
247 | help | ||
248 | This enables the CPU frequency driver for AT32AP processors. | ||
249 | If in doubt, say N. | ||
250 | endif | ||
251 | |||
252 | if IA64 | 242 | if IA64 |
253 | config IA64_ACPI_CPUFREQ | 243 | config IA64_ACPI_CPUFREQ |
254 | tristate "ACPI Processor P-States driver" | 244 | tristate "ACPI Processor P-States driver" |
diff --git a/drivers/cpufreq/Makefile b/drivers/cpufreq/Makefile index e07715ce8844..c60c1e141d9d 100644 --- a/drivers/cpufreq/Makefile +++ b/drivers/cpufreq/Makefile | |||
@@ -100,7 +100,6 @@ obj-$(CONFIG_POWERNV_CPUFREQ) += powernv-cpufreq.o | |||
100 | 100 | ||
101 | ################################################################################## | 101 | ################################################################################## |
102 | # Other platform drivers | 102 | # Other platform drivers |
103 | obj-$(CONFIG_AVR32_AT32AP_CPUFREQ) += at32ap-cpufreq.o | ||
104 | obj-$(CONFIG_BFIN_CPU_FREQ) += blackfin-cpufreq.o | 103 | obj-$(CONFIG_BFIN_CPU_FREQ) += blackfin-cpufreq.o |
105 | obj-$(CONFIG_BMIPS_CPUFREQ) += bmips-cpufreq.o | 104 | obj-$(CONFIG_BMIPS_CPUFREQ) += bmips-cpufreq.o |
106 | obj-$(CONFIG_CRIS_MACH_ARTPEC3) += cris-artpec3-cpufreq.o | 105 | obj-$(CONFIG_CRIS_MACH_ARTPEC3) += cris-artpec3-cpufreq.o |
diff --git a/drivers/cpufreq/at32ap-cpufreq.c b/drivers/cpufreq/at32ap-cpufreq.c deleted file mode 100644 index 7b612c8bb09e..000000000000 --- a/drivers/cpufreq/at32ap-cpufreq.c +++ /dev/null | |||
@@ -1,127 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2004-2007 Atmel Corporation | ||
3 | * | ||
4 | * Based on MIPS implementation arch/mips/kernel/time.c | ||
5 | * Copyright 2001 MontaVista Software Inc. | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | /*#define DEBUG*/ | ||
13 | |||
14 | #include <linux/kernel.h> | ||
15 | #include <linux/types.h> | ||
16 | #include <linux/init.h> | ||
17 | #include <linux/cpufreq.h> | ||
18 | #include <linux/io.h> | ||
19 | #include <linux/clk.h> | ||
20 | #include <linux/err.h> | ||
21 | #include <linux/export.h> | ||
22 | #include <linux/slab.h> | ||
23 | |||
24 | static struct cpufreq_frequency_table *freq_table; | ||
25 | |||
26 | static unsigned int ref_freq; | ||
27 | static unsigned long loops_per_jiffy_ref; | ||
28 | |||
29 | static int at32_set_target(struct cpufreq_policy *policy, unsigned int index) | ||
30 | { | ||
31 | unsigned int old_freq, new_freq; | ||
32 | |||
33 | old_freq = policy->cur; | ||
34 | new_freq = freq_table[index].frequency; | ||
35 | |||
36 | if (!ref_freq) { | ||
37 | ref_freq = old_freq; | ||
38 | loops_per_jiffy_ref = boot_cpu_data.loops_per_jiffy; | ||
39 | } | ||
40 | |||
41 | if (old_freq < new_freq) | ||
42 | boot_cpu_data.loops_per_jiffy = cpufreq_scale( | ||
43 | loops_per_jiffy_ref, ref_freq, new_freq); | ||
44 | clk_set_rate(policy->clk, new_freq * 1000); | ||
45 | if (new_freq < old_freq) | ||
46 | boot_cpu_data.loops_per_jiffy = cpufreq_scale( | ||
47 | loops_per_jiffy_ref, ref_freq, new_freq); | ||
48 | |||
49 | return 0; | ||
50 | } | ||
51 | |||
52 | static int at32_cpufreq_driver_init(struct cpufreq_policy *policy) | ||
53 | { | ||
54 | unsigned int frequency, rate, min_freq; | ||
55 | struct clk *cpuclk; | ||
56 | int retval, steps, i; | ||
57 | |||
58 | if (policy->cpu != 0) | ||
59 | return -EINVAL; | ||
60 | |||
61 | cpuclk = clk_get(NULL, "cpu"); | ||
62 | if (IS_ERR(cpuclk)) { | ||
63 | pr_debug("cpufreq: could not get CPU clk\n"); | ||
64 | retval = PTR_ERR(cpuclk); | ||
65 | goto out_err; | ||
66 | } | ||
67 | |||
68 | min_freq = (clk_round_rate(cpuclk, 1) + 500) / 1000; | ||
69 | frequency = (clk_round_rate(cpuclk, ~0UL) + 500) / 1000; | ||
70 | policy->cpuinfo.transition_latency = 0; | ||
71 | |||
72 | /* | ||
73 | * AVR32 CPU frequency rate scales in power of two between maximum and | ||
74 | * minimum, also add space for the table end marker. | ||
75 | * | ||
76 | * Further validate that the frequency is usable, and append it to the | ||
77 | * frequency table. | ||
78 | */ | ||
79 | steps = fls(frequency / min_freq) + 1; | ||
80 | freq_table = kzalloc(steps * sizeof(struct cpufreq_frequency_table), | ||
81 | GFP_KERNEL); | ||
82 | if (!freq_table) { | ||
83 | retval = -ENOMEM; | ||
84 | goto out_err_put_clk; | ||
85 | } | ||
86 | |||
87 | for (i = 0; i < (steps - 1); i++) { | ||
88 | rate = clk_round_rate(cpuclk, frequency * 1000) / 1000; | ||
89 | |||
90 | if (rate != frequency) | ||
91 | freq_table[i].frequency = CPUFREQ_ENTRY_INVALID; | ||
92 | else | ||
93 | freq_table[i].frequency = frequency; | ||
94 | |||
95 | frequency /= 2; | ||
96 | } | ||
97 | |||
98 | policy->clk = cpuclk; | ||
99 | freq_table[steps - 1].frequency = CPUFREQ_TABLE_END; | ||
100 | |||
101 | retval = cpufreq_table_validate_and_show(policy, freq_table); | ||
102 | if (!retval) { | ||
103 | printk("cpufreq: AT32AP CPU frequency driver\n"); | ||
104 | return 0; | ||
105 | } | ||
106 | |||
107 | kfree(freq_table); | ||
108 | out_err_put_clk: | ||
109 | clk_put(cpuclk); | ||
110 | out_err: | ||
111 | return retval; | ||
112 | } | ||
113 | |||
114 | static struct cpufreq_driver at32_driver = { | ||
115 | .name = "at32ap", | ||
116 | .init = at32_cpufreq_driver_init, | ||
117 | .verify = cpufreq_generic_frequency_table_verify, | ||
118 | .target_index = at32_set_target, | ||
119 | .get = cpufreq_generic_get, | ||
120 | .flags = CPUFREQ_STICKY, | ||
121 | }; | ||
122 | |||
123 | static int __init at32_cpufreq_init(void) | ||
124 | { | ||
125 | return cpufreq_register_driver(&at32_driver); | ||
126 | } | ||
127 | late_initcall(at32_cpufreq_init); | ||