diff options
author | Rafael J. Wysocki <rjw@rjwysocki.net> | 2013-10-25 16:36:40 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rjw@rjwysocki.net> | 2013-10-25 16:36:40 -0400 |
commit | 6ddee424fea2d269c2f402278d93165c7b92dc58 (patch) | |
tree | c1b1d0d9058846a6da22def648dea61e16faacd0 /drivers/cpufreq/imx6q-cpufreq.c | |
parent | e4db1c7439b31993a4886b273bb9235a8eea82bf (diff) | |
parent | a814613b9a32d9ab9578d9dab396265c826d37f0 (diff) |
Merge back earlier 'pm-cpufreq' material.
Conflicts:
drivers/cpufreq/omap-cpufreq.c
Diffstat (limited to 'drivers/cpufreq/imx6q-cpufreq.c')
-rw-r--r-- | drivers/cpufreq/imx6q-cpufreq.c | 37 |
1 files changed, 4 insertions, 33 deletions
diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c index e4c914066601..be23892282e3 100644 --- a/drivers/cpufreq/imx6q-cpufreq.c +++ b/drivers/cpufreq/imx6q-cpufreq.c | |||
@@ -35,11 +35,6 @@ static struct device *cpu_dev; | |||
35 | static struct cpufreq_frequency_table *freq_table; | 35 | static struct cpufreq_frequency_table *freq_table; |
36 | static unsigned int transition_latency; | 36 | static unsigned int transition_latency; |
37 | 37 | ||
38 | static int imx6q_verify_speed(struct cpufreq_policy *policy) | ||
39 | { | ||
40 | return cpufreq_frequency_table_verify(policy, freq_table); | ||
41 | } | ||
42 | |||
43 | static unsigned int imx6q_get_speed(unsigned int cpu) | 38 | static unsigned int imx6q_get_speed(unsigned int cpu) |
44 | { | 39 | { |
45 | return clk_get_rate(arm_clk) / 1000; | 40 | return clk_get_rate(arm_clk) / 1000; |
@@ -159,41 +154,17 @@ post_notify: | |||
159 | 154 | ||
160 | static int imx6q_cpufreq_init(struct cpufreq_policy *policy) | 155 | static int imx6q_cpufreq_init(struct cpufreq_policy *policy) |
161 | { | 156 | { |
162 | int ret; | 157 | return cpufreq_generic_init(policy, freq_table, transition_latency); |
163 | |||
164 | ret = cpufreq_frequency_table_cpuinfo(policy, freq_table); | ||
165 | if (ret) { | ||
166 | dev_err(cpu_dev, "invalid frequency table: %d\n", ret); | ||
167 | return ret; | ||
168 | } | ||
169 | |||
170 | policy->cpuinfo.transition_latency = transition_latency; | ||
171 | policy->cur = clk_get_rate(arm_clk) / 1000; | ||
172 | cpumask_setall(policy->cpus); | ||
173 | cpufreq_frequency_table_get_attr(freq_table, policy->cpu); | ||
174 | |||
175 | return 0; | ||
176 | } | ||
177 | |||
178 | static int imx6q_cpufreq_exit(struct cpufreq_policy *policy) | ||
179 | { | ||
180 | cpufreq_frequency_table_put_attr(policy->cpu); | ||
181 | return 0; | ||
182 | } | 158 | } |
183 | 159 | ||
184 | static struct freq_attr *imx6q_cpufreq_attr[] = { | ||
185 | &cpufreq_freq_attr_scaling_available_freqs, | ||
186 | NULL, | ||
187 | }; | ||
188 | |||
189 | static struct cpufreq_driver imx6q_cpufreq_driver = { | 160 | static struct cpufreq_driver imx6q_cpufreq_driver = { |
190 | .verify = imx6q_verify_speed, | 161 | .verify = cpufreq_generic_frequency_table_verify, |
191 | .target = imx6q_set_target, | 162 | .target = imx6q_set_target, |
192 | .get = imx6q_get_speed, | 163 | .get = imx6q_get_speed, |
193 | .init = imx6q_cpufreq_init, | 164 | .init = imx6q_cpufreq_init, |
194 | .exit = imx6q_cpufreq_exit, | 165 | .exit = cpufreq_generic_exit, |
195 | .name = "imx6q-cpufreq", | 166 | .name = "imx6q-cpufreq", |
196 | .attr = imx6q_cpufreq_attr, | 167 | .attr = cpufreq_generic_attr, |
197 | }; | 168 | }; |
198 | 169 | ||
199 | static int imx6q_cpufreq_probe(struct platform_device *pdev) | 170 | static int imx6q_cpufreq_probe(struct platform_device *pdev) |