aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq
diff options
context:
space:
mode:
authorLee Jones <lee.jones@linaro.org>2012-12-10 10:25:38 -0500
committerLinus Walleij <linus.walleij@linaro.org>2013-01-07 10:03:01 -0500
commitedb10c11c9af64efc8cdb001ada9792e0b2eef42 (patch)
tree8e076e21f54ece5545fe6db87c3916c813e23a42 /drivers/cpufreq
parentd1c3ed669a2d452cacfb48c2d171a1f364dae2ed (diff)
cpufreq: Give driver used for dbx500 family a more generic name
This driver doesn't only handle cpufreq functionality for the db8500 anymore. There are new variants which rely on it too. Let's make the name a bit more generic. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Acked-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r--drivers/cpufreq/Makefile2
-rw-r--r--drivers/cpufreq/dbx500-cpufreq.c (renamed from drivers/cpufreq/db8500-cpufreq.c)58
2 files changed, 30 insertions, 30 deletions
diff --git a/drivers/cpufreq/Makefile b/drivers/cpufreq/Makefile
index 1f254ec087c1..6700251f7e90 100644
--- a/drivers/cpufreq/Makefile
+++ b/drivers/cpufreq/Makefile
@@ -41,7 +41,7 @@ obj-$(CONFIG_X86_CPUFREQ_NFORCE2) += cpufreq-nforce2.o
41 41
42################################################################################## 42##################################################################################
43# ARM SoC drivers 43# ARM SoC drivers
44obj-$(CONFIG_UX500_SOC_DB8500) += db8500-cpufreq.o 44obj-$(CONFIG_UX500_SOC_DB8500) += dbx500-cpufreq.o
45obj-$(CONFIG_ARM_S3C2416_CPUFREQ) += s3c2416-cpufreq.o 45obj-$(CONFIG_ARM_S3C2416_CPUFREQ) += s3c2416-cpufreq.o
46obj-$(CONFIG_ARM_S3C64XX_CPUFREQ) += s3c64xx-cpufreq.o 46obj-$(CONFIG_ARM_S3C64XX_CPUFREQ) += s3c64xx-cpufreq.o
47obj-$(CONFIG_ARM_S5PV210_CPUFREQ) += s5pv210-cpufreq.o 47obj-$(CONFIG_ARM_S5PV210_CPUFREQ) += s5pv210-cpufreq.o
diff --git a/drivers/cpufreq/db8500-cpufreq.c b/drivers/cpufreq/dbx500-cpufreq.c
index 4f154bc0ebe4..0a411b54972a 100644
--- a/drivers/cpufreq/db8500-cpufreq.c
+++ b/drivers/cpufreq/dbx500-cpufreq.c
@@ -20,17 +20,17 @@
20static struct cpufreq_frequency_table *freq_table; 20static struct cpufreq_frequency_table *freq_table;
21static struct clk *armss_clk; 21static struct clk *armss_clk;
22 22
23static struct freq_attr *db8500_cpufreq_attr[] = { 23static struct freq_attr *dbx500_cpufreq_attr[] = {
24 &cpufreq_freq_attr_scaling_available_freqs, 24 &cpufreq_freq_attr_scaling_available_freqs,
25 NULL, 25 NULL,
26}; 26};
27 27
28static int db8500_cpufreq_verify_speed(struct cpufreq_policy *policy) 28static int dbx500_cpufreq_verify_speed(struct cpufreq_policy *policy)
29{ 29{
30 return cpufreq_frequency_table_verify(policy, freq_table); 30 return cpufreq_frequency_table_verify(policy, freq_table);
31} 31}
32 32
33static int db8500_cpufreq_target(struct cpufreq_policy *policy, 33static int dbx500_cpufreq_target(struct cpufreq_policy *policy,
34 unsigned int target_freq, 34 unsigned int target_freq,
35 unsigned int relation) 35 unsigned int relation)
36{ 36{
@@ -61,7 +61,7 @@ static int db8500_cpufreq_target(struct cpufreq_policy *policy,
61 61
62 /* update armss clk frequency */ 62 /* update armss clk frequency */
63 if (clk_set_rate(armss_clk, freq_table[idx].frequency * 1000)) { 63 if (clk_set_rate(armss_clk, freq_table[idx].frequency * 1000)) {
64 pr_err("db8500-cpufreq: Failed to update armss clk\n"); 64 pr_err("dbx500-cpufreq: Failed to update armss clk\n");
65 return -EINVAL; 65 return -EINVAL;
66 } 66 }
67 67
@@ -72,7 +72,7 @@ static int db8500_cpufreq_target(struct cpufreq_policy *policy,
72 return 0; 72 return 0;
73} 73}
74 74
75static unsigned int db8500_cpufreq_getspeed(unsigned int cpu) 75static unsigned int dbx500_cpufreq_getspeed(unsigned int cpu)
76{ 76{
77 int i = 0; 77 int i = 0;
78 unsigned long freq = clk_get_rate(armss_clk) / 1000; 78 unsigned long freq = clk_get_rate(armss_clk) / 1000;
@@ -84,22 +84,22 @@ static unsigned int db8500_cpufreq_getspeed(unsigned int cpu)
84 } 84 }
85 85
86 /* We could not find a corresponding frequency. */ 86 /* We could not find a corresponding frequency. */
87 pr_err("db8500-cpufreq: Failed to find cpufreq speed\n"); 87 pr_err("dbx500-cpufreq: Failed to find cpufreq speed\n");
88 return 0; 88 return 0;
89} 89}
90 90
91static int __cpuinit db8500_cpufreq_init(struct cpufreq_policy *policy) 91static int __cpuinit dbx500_cpufreq_init(struct cpufreq_policy *policy)
92{ 92{
93 int i = 0; 93 int i = 0;
94 int res; 94 int res;
95 95
96 armss_clk = clk_get(NULL, "armss"); 96 armss_clk = clk_get(NULL, "armss");
97 if (IS_ERR(armss_clk)) { 97 if (IS_ERR(armss_clk)) {
98 pr_err("db8500-cpufreq : Failed to get armss clk\n"); 98 pr_err("dbx500-cpufreq : Failed to get armss clk\n");
99 return PTR_ERR(armss_clk); 99 return PTR_ERR(armss_clk);
100 } 100 }
101 101
102 pr_info("db8500-cpufreq : Available frequencies:\n"); 102 pr_info("dbx500-cpufreq : Available frequencies:\n");
103 while (freq_table[i].frequency != CPUFREQ_TABLE_END) { 103 while (freq_table[i].frequency != CPUFREQ_TABLE_END) {
104 pr_info(" %d Mhz\n", freq_table[i].frequency/1000); 104 pr_info(" %d Mhz\n", freq_table[i].frequency/1000);
105 i++; 105 i++;
@@ -110,14 +110,14 @@ static int __cpuinit db8500_cpufreq_init(struct cpufreq_policy *policy)
110 if (!res) 110 if (!res)
111 cpufreq_frequency_table_get_attr(freq_table, policy->cpu); 111 cpufreq_frequency_table_get_attr(freq_table, policy->cpu);
112 else { 112 else {
113 pr_err("db8500-cpufreq : Failed to read policy table\n"); 113 pr_err("dbx500-cpufreq : Failed to read policy table\n");
114 clk_put(armss_clk); 114 clk_put(armss_clk);
115 return res; 115 return res;
116 } 116 }
117 117
118 policy->min = policy->cpuinfo.min_freq; 118 policy->min = policy->cpuinfo.min_freq;
119 policy->max = policy->cpuinfo.max_freq; 119 policy->max = policy->cpuinfo.max_freq;
120 policy->cur = db8500_cpufreq_getspeed(policy->cpu); 120 policy->cur = dbx500_cpufreq_getspeed(policy->cpu);
121 policy->governor = CPUFREQ_DEFAULT_GOVERNOR; 121 policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
122 122
123 /* 123 /*
@@ -135,45 +135,45 @@ static int __cpuinit db8500_cpufreq_init(struct cpufreq_policy *policy)
135 return 0; 135 return 0;
136} 136}
137 137
138static struct cpufreq_driver db8500_cpufreq_driver = { 138static struct cpufreq_driver dbx500_cpufreq_driver = {
139 .flags = CPUFREQ_STICKY, 139 .flags = CPUFREQ_STICKY,
140 .verify = db8500_cpufreq_verify_speed, 140 .verify = dbx500_cpufreq_verify_speed,
141 .target = db8500_cpufreq_target, 141 .target = dbx500_cpufreq_target,
142 .get = db8500_cpufreq_getspeed, 142 .get = dbx500_cpufreq_getspeed,
143 .init = db8500_cpufreq_init, 143 .init = dbx500_cpufreq_init,
144 .name = "DB8500", 144 .name = "DBX500",
145 .attr = db8500_cpufreq_attr, 145 .attr = dbx500_cpufreq_attr,
146}; 146};
147 147
148static int db8500_cpufreq_probe(struct platform_device *pdev) 148static int dbx500_cpufreq_probe(struct platform_device *pdev)
149{ 149{
150 freq_table = dev_get_platdata(&pdev->dev); 150 freq_table = dev_get_platdata(&pdev->dev);
151 151
152 if (!freq_table) { 152 if (!freq_table) {
153 pr_err("db8500-cpufreq: Failed to fetch cpufreq table\n"); 153 pr_err("dbx500-cpufreq: Failed to fetch cpufreq table\n");
154 return -ENODEV; 154 return -ENODEV;
155 } 155 }
156 156
157 return cpufreq_register_driver(&db8500_cpufreq_driver); 157 return cpufreq_register_driver(&dbx500_cpufreq_driver);
158} 158}
159 159
160static struct platform_driver db8500_cpufreq_plat_driver = { 160static struct platform_driver dbx500_cpufreq_plat_driver = {
161 .driver = { 161 .driver = {
162 .name = "cpufreq-u8500", 162 .name = "cpufreq-ux500",
163 .owner = THIS_MODULE, 163 .owner = THIS_MODULE,
164 }, 164 },
165 .probe = db8500_cpufreq_probe, 165 .probe = dbx500_cpufreq_probe,
166}; 166};
167 167
168static int __init db8500_cpufreq_register(void) 168static int __init dbx500_cpufreq_register(void)
169{ 169{
170 if (!cpu_is_u8500_family()) 170 if (!cpu_is_u8500_family())
171 return -ENODEV; 171 return -ENODEV;
172 172
173 pr_info("cpufreq for DB8500 started\n"); 173 pr_info("cpufreq for DBX500 started\n");
174 return platform_driver_register(&db8500_cpufreq_plat_driver); 174 return platform_driver_register(&dbx500_cpufreq_plat_driver);
175} 175}
176device_initcall(db8500_cpufreq_register); 176device_initcall(dbx500_cpufreq_register);
177 177
178MODULE_LICENSE("GPL v2"); 178MODULE_LICENSE("GPL v2");
179MODULE_DESCRIPTION("cpufreq driver for DB8500"); 179MODULE_DESCRIPTION("cpufreq driver for DBX500");