summaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/dbx500-cpufreq.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/cpufreq/dbx500-cpufreq.c')
-rw-r--r--drivers/cpufreq/dbx500-cpufreq.c42
1 files changed, 3 insertions, 39 deletions
diff --git a/drivers/cpufreq/dbx500-cpufreq.c b/drivers/cpufreq/dbx500-cpufreq.c
index 26321cdc1946..a60f7693c18e 100644
--- a/drivers/cpufreq/dbx500-cpufreq.c
+++ b/drivers/cpufreq/dbx500-cpufreq.c
@@ -19,16 +19,6 @@
19static struct cpufreq_frequency_table *freq_table; 19static struct cpufreq_frequency_table *freq_table;
20static struct clk *armss_clk; 20static struct clk *armss_clk;
21 21
22static struct freq_attr *dbx500_cpufreq_attr[] = {
23 &cpufreq_freq_attr_scaling_available_freqs,
24 NULL,
25};
26
27static int dbx500_cpufreq_verify_speed(struct cpufreq_policy *policy)
28{
29 return cpufreq_frequency_table_verify(policy, freq_table);
30}
31
32static int dbx500_cpufreq_target(struct cpufreq_policy *policy, 22static int dbx500_cpufreq_target(struct cpufreq_policy *policy,
33 unsigned int target_freq, 23 unsigned int target_freq,
34 unsigned int relation) 24 unsigned int relation)
@@ -84,43 +74,17 @@ static unsigned int dbx500_cpufreq_getspeed(unsigned int cpu)
84 74
85static int dbx500_cpufreq_init(struct cpufreq_policy *policy) 75static int dbx500_cpufreq_init(struct cpufreq_policy *policy)
86{ 76{
87 int res; 77 return cpufreq_generic_init(policy, freq_table, 20 * 1000);
88
89 /* get policy fields based on the table */
90 res = cpufreq_frequency_table_cpuinfo(policy, freq_table);
91 if (!res)
92 cpufreq_frequency_table_get_attr(freq_table, policy->cpu);
93 else {
94 pr_err("dbx500-cpufreq: Failed to read policy table\n");
95 return res;
96 }
97
98 policy->min = policy->cpuinfo.min_freq;
99 policy->max = policy->cpuinfo.max_freq;
100 policy->cur = dbx500_cpufreq_getspeed(policy->cpu);
101 policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
102
103 /*
104 * FIXME : Need to take time measurement across the target()
105 * function with no/some/all drivers in the notification
106 * list.
107 */
108 policy->cpuinfo.transition_latency = 20 * 1000; /* in ns */
109
110 /* policy sharing between dual CPUs */
111 cpumask_setall(policy->cpus);
112
113 return 0;
114} 78}
115 79
116static struct cpufreq_driver dbx500_cpufreq_driver = { 80static struct cpufreq_driver dbx500_cpufreq_driver = {
117 .flags = CPUFREQ_STICKY | CPUFREQ_CONST_LOOPS, 81 .flags = CPUFREQ_STICKY | CPUFREQ_CONST_LOOPS,
118 .verify = dbx500_cpufreq_verify_speed, 82 .verify = cpufreq_generic_frequency_table_verify,
119 .target = dbx500_cpufreq_target, 83 .target = dbx500_cpufreq_target,
120 .get = dbx500_cpufreq_getspeed, 84 .get = dbx500_cpufreq_getspeed,
121 .init = dbx500_cpufreq_init, 85 .init = dbx500_cpufreq_init,
122 .name = "DBX500", 86 .name = "DBX500",
123 .attr = dbx500_cpufreq_attr, 87 .attr = cpufreq_generic_attr,
124}; 88};
125 89
126static int dbx500_cpufreq_probe(struct platform_device *pdev) 90static int dbx500_cpufreq_probe(struct platform_device *pdev)