aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2014-09-09 10:28:03 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-10-03 09:37:54 -0400
commitbbcf071969b20f356877c8067986be0a2dcaa2aa (patch)
tree56c887ddf156924bcf86716690f51080ebdbfc21 /drivers/cpufreq
parent0bf18f19be4d26545d7aa3114091cffe556572be (diff)
cpufreq: cpu0: rename driver and internals to 'cpufreq_dt'
The naming convention of this driver was always under the scanner, people complained that it should have a more generic name than cpu0, as it manages all CPUs that are sharing clock lines. Also, in future it will be modified to support any number of clusters with separate clock/voltage lines. Lets rename it to 'cpufreq_dt' from 'cpufreq_cpu0'. Tested-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r--drivers/cpufreq/Kconfig8
-rw-r--r--drivers/cpufreq/Kconfig.arm2
-rw-r--r--drivers/cpufreq/Makefile2
-rw-r--r--drivers/cpufreq/cpufreq-dt.c (renamed from drivers/cpufreq/cpufreq-cpu0.c)38
-rw-r--r--drivers/cpufreq/exynos4210-cpufreq.c2
-rw-r--r--drivers/cpufreq/exynos4x12-cpufreq.c2
-rw-r--r--drivers/cpufreq/exynos5250-cpufreq.c2
-rw-r--r--drivers/cpufreq/highbank-cpufreq.c6
-rw-r--r--drivers/cpufreq/s5pv210-cpufreq.c2
9 files changed, 32 insertions, 32 deletions
diff --git a/drivers/cpufreq/Kconfig b/drivers/cpufreq/Kconfig
index ffe350f86bca..3489f8f5fada 100644
--- a/drivers/cpufreq/Kconfig
+++ b/drivers/cpufreq/Kconfig
@@ -183,14 +183,14 @@ config CPU_FREQ_GOV_CONSERVATIVE
183 183
184 If in doubt, say N. 184 If in doubt, say N.
185 185
186config GENERIC_CPUFREQ_CPU0 186config CPUFREQ_DT
187 tristate "Generic CPU0 cpufreq driver" 187 tristate "Generic DT based cpufreq driver"
188 depends on HAVE_CLK && OF 188 depends on HAVE_CLK && OF
189 # if CPU_THERMAL is on and THERMAL=m, CPU0 cannot be =y: 189 # if CPU_THERMAL is on and THERMAL=m, CPUFREQ_DT cannot be =y:
190 depends on !CPU_THERMAL || THERMAL 190 depends on !CPU_THERMAL || THERMAL
191 select PM_OPP 191 select PM_OPP
192 help 192 help
193 This adds a generic cpufreq driver for CPU0 frequency management. 193 This adds a generic DT based cpufreq driver for frequency management.
194 It supports both uniprocessor (UP) and symmetric multiprocessor (SMP) 194 It supports both uniprocessor (UP) and symmetric multiprocessor (SMP)
195 systems which share clock and voltage across all CPUs. 195 systems which share clock and voltage across all CPUs.
196 196
diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm
index 7364a538e056..48ed28b789f7 100644
--- a/drivers/cpufreq/Kconfig.arm
+++ b/drivers/cpufreq/Kconfig.arm
@@ -92,7 +92,7 @@ config ARM_EXYNOS_CPU_FREQ_BOOST_SW
92 92
93config ARM_HIGHBANK_CPUFREQ 93config ARM_HIGHBANK_CPUFREQ
94 tristate "Calxeda Highbank-based" 94 tristate "Calxeda Highbank-based"
95 depends on ARCH_HIGHBANK && GENERIC_CPUFREQ_CPU0 && REGULATOR 95 depends on ARCH_HIGHBANK && CPUFREQ_DT && REGULATOR
96 default m 96 default m
97 help 97 help
98 This adds the CPUFreq driver for Calxeda Highbank SoC 98 This adds the CPUFreq driver for Calxeda Highbank SoC
diff --git a/drivers/cpufreq/Makefile b/drivers/cpufreq/Makefile
index db6d9a2fea4d..40c53dc1937e 100644
--- a/drivers/cpufreq/Makefile
+++ b/drivers/cpufreq/Makefile
@@ -13,7 +13,7 @@ obj-$(CONFIG_CPU_FREQ_GOV_ONDEMAND) += cpufreq_ondemand.o
13obj-$(CONFIG_CPU_FREQ_GOV_CONSERVATIVE) += cpufreq_conservative.o 13obj-$(CONFIG_CPU_FREQ_GOV_CONSERVATIVE) += cpufreq_conservative.o
14obj-$(CONFIG_CPU_FREQ_GOV_COMMON) += cpufreq_governor.o 14obj-$(CONFIG_CPU_FREQ_GOV_COMMON) += cpufreq_governor.o
15 15
16obj-$(CONFIG_GENERIC_CPUFREQ_CPU0) += cpufreq-cpu0.o 16obj-$(CONFIG_CPUFREQ_DT) += cpufreq-dt.o
17 17
18################################################################################## 18##################################################################################
19# x86 drivers. 19# x86 drivers.
diff --git a/drivers/cpufreq/cpufreq-cpu0.c b/drivers/cpufreq/cpufreq-dt.c
index a5f8c5f5f4f4..e00265066a75 100644
--- a/drivers/cpufreq/cpufreq-cpu0.c
+++ b/drivers/cpufreq/cpufreq-dt.c
@@ -4,7 +4,7 @@
4 * Copyright (C) 2014 Linaro. 4 * Copyright (C) 2014 Linaro.
5 * Viresh Kumar <viresh.kumar@linaro.org> 5 * Viresh Kumar <viresh.kumar@linaro.org>
6 * 6 *
7 * The OPP code in function cpu0_set_target() is reused from 7 * The OPP code in function set_target() is reused from
8 * drivers/cpufreq/omap-cpufreq.c 8 * drivers/cpufreq/omap-cpufreq.c
9 * 9 *
10 * This program is free software; you can redistribute it and/or modify 10 * This program is free software; you can redistribute it and/or modify
@@ -35,7 +35,7 @@ struct private_data {
35 unsigned int voltage_tolerance; /* in percentage */ 35 unsigned int voltage_tolerance; /* in percentage */
36}; 36};
37 37
38static int cpu0_set_target(struct cpufreq_policy *policy, unsigned int index) 38static int set_target(struct cpufreq_policy *policy, unsigned int index)
39{ 39{
40 struct dev_pm_opp *opp; 40 struct dev_pm_opp *opp;
41 struct cpufreq_frequency_table *freq_table = policy->freq_table; 41 struct cpufreq_frequency_table *freq_table = policy->freq_table;
@@ -176,7 +176,7 @@ try_again:
176 return ret; 176 return ret;
177} 177}
178 178
179static int cpu0_cpufreq_init(struct cpufreq_policy *policy) 179static int cpufreq_init(struct cpufreq_policy *policy)
180{ 180{
181 struct cpufreq_frequency_table *freq_table; 181 struct cpufreq_frequency_table *freq_table;
182 struct thermal_cooling_device *cdev; 182 struct thermal_cooling_device *cdev;
@@ -287,7 +287,7 @@ out_put_reg_clk:
287 return ret; 287 return ret;
288} 288}
289 289
290static int cpu0_cpufreq_exit(struct cpufreq_policy *policy) 290static int cpufreq_exit(struct cpufreq_policy *policy)
291{ 291{
292 struct private_data *priv = policy->driver_data; 292 struct private_data *priv = policy->driver_data;
293 293
@@ -301,18 +301,18 @@ static int cpu0_cpufreq_exit(struct cpufreq_policy *policy)
301 return 0; 301 return 0;
302} 302}
303 303
304static struct cpufreq_driver cpu0_cpufreq_driver = { 304static struct cpufreq_driver dt_cpufreq_driver = {
305 .flags = CPUFREQ_STICKY | CPUFREQ_NEED_INITIAL_FREQ_CHECK, 305 .flags = CPUFREQ_STICKY | CPUFREQ_NEED_INITIAL_FREQ_CHECK,
306 .verify = cpufreq_generic_frequency_table_verify, 306 .verify = cpufreq_generic_frequency_table_verify,
307 .target_index = cpu0_set_target, 307 .target_index = set_target,
308 .get = cpufreq_generic_get, 308 .get = cpufreq_generic_get,
309 .init = cpu0_cpufreq_init, 309 .init = cpufreq_init,
310 .exit = cpu0_cpufreq_exit, 310 .exit = cpufreq_exit,
311 .name = "generic_cpu0", 311 .name = "cpufreq-dt",
312 .attr = cpufreq_generic_attr, 312 .attr = cpufreq_generic_attr,
313}; 313};
314 314
315static int cpu0_cpufreq_probe(struct platform_device *pdev) 315static int dt_cpufreq_probe(struct platform_device *pdev)
316{ 316{
317 struct device *cpu_dev; 317 struct device *cpu_dev;
318 struct regulator *cpu_reg; 318 struct regulator *cpu_reg;
@@ -334,30 +334,30 @@ static int cpu0_cpufreq_probe(struct platform_device *pdev)
334 if (!IS_ERR(cpu_reg)) 334 if (!IS_ERR(cpu_reg))
335 regulator_put(cpu_reg); 335 regulator_put(cpu_reg);
336 336
337 ret = cpufreq_register_driver(&cpu0_cpufreq_driver); 337 ret = cpufreq_register_driver(&dt_cpufreq_driver);
338 if (ret) 338 if (ret)
339 dev_err(cpu_dev, "failed register driver: %d\n", ret); 339 dev_err(cpu_dev, "failed register driver: %d\n", ret);
340 340
341 return ret; 341 return ret;
342} 342}
343 343
344static int cpu0_cpufreq_remove(struct platform_device *pdev) 344static int dt_cpufreq_remove(struct platform_device *pdev)
345{ 345{
346 cpufreq_unregister_driver(&cpu0_cpufreq_driver); 346 cpufreq_unregister_driver(&dt_cpufreq_driver);
347 return 0; 347 return 0;
348} 348}
349 349
350static struct platform_driver cpu0_cpufreq_platdrv = { 350static struct platform_driver dt_cpufreq_platdrv = {
351 .driver = { 351 .driver = {
352 .name = "cpufreq-cpu0", 352 .name = "cpufreq-dt",
353 .owner = THIS_MODULE, 353 .owner = THIS_MODULE,
354 }, 354 },
355 .probe = cpu0_cpufreq_probe, 355 .probe = dt_cpufreq_probe,
356 .remove = cpu0_cpufreq_remove, 356 .remove = dt_cpufreq_remove,
357}; 357};
358module_platform_driver(cpu0_cpufreq_platdrv); 358module_platform_driver(dt_cpufreq_platdrv);
359 359
360MODULE_AUTHOR("Viresh Kumar <viresh.kumar@linaro.org>"); 360MODULE_AUTHOR("Viresh Kumar <viresh.kumar@linaro.org>");
361MODULE_AUTHOR("Shawn Guo <shawn.guo@linaro.org>"); 361MODULE_AUTHOR("Shawn Guo <shawn.guo@linaro.org>");
362MODULE_DESCRIPTION("Generic CPU0 cpufreq driver"); 362MODULE_DESCRIPTION("Generic cpufreq driver");
363MODULE_LICENSE("GPL"); 363MODULE_LICENSE("GPL");
diff --git a/drivers/cpufreq/exynos4210-cpufreq.c b/drivers/cpufreq/exynos4210-cpufreq.c
index 61a54310a1b9..843ec824fd91 100644
--- a/drivers/cpufreq/exynos4210-cpufreq.c
+++ b/drivers/cpufreq/exynos4210-cpufreq.c
@@ -127,7 +127,7 @@ int exynos4210_cpufreq_init(struct exynos_dvfs_info *info)
127 * dependencies on platform headers. It is necessary to enable 127 * dependencies on platform headers. It is necessary to enable
128 * Exynos multi-platform support and will be removed together with 128 * Exynos multi-platform support and will be removed together with
129 * this whole driver as soon as Exynos gets migrated to use 129 * this whole driver as soon as Exynos gets migrated to use
130 * cpufreq-cpu0 driver. 130 * cpufreq-dt driver.
131 */ 131 */
132 np = of_find_compatible_node(NULL, NULL, "samsung,exynos4210-clock"); 132 np = of_find_compatible_node(NULL, NULL, "samsung,exynos4210-clock");
133 if (!np) { 133 if (!np) {
diff --git a/drivers/cpufreq/exynos4x12-cpufreq.c b/drivers/cpufreq/exynos4x12-cpufreq.c
index 351a2074cfea..9e78a850e29f 100644
--- a/drivers/cpufreq/exynos4x12-cpufreq.c
+++ b/drivers/cpufreq/exynos4x12-cpufreq.c
@@ -174,7 +174,7 @@ int exynos4x12_cpufreq_init(struct exynos_dvfs_info *info)
174 * dependencies on platform headers. It is necessary to enable 174 * dependencies on platform headers. It is necessary to enable
175 * Exynos multi-platform support and will be removed together with 175 * Exynos multi-platform support and will be removed together with
176 * this whole driver as soon as Exynos gets migrated to use 176 * this whole driver as soon as Exynos gets migrated to use
177 * cpufreq-cpu0 driver. 177 * cpufreq-dt driver.
178 */ 178 */
179 np = of_find_compatible_node(NULL, NULL, "samsung,exynos4412-clock"); 179 np = of_find_compatible_node(NULL, NULL, "samsung,exynos4412-clock");
180 if (!np) { 180 if (!np) {
diff --git a/drivers/cpufreq/exynos5250-cpufreq.c b/drivers/cpufreq/exynos5250-cpufreq.c
index c91ce69dc631..3eafdc7ba787 100644
--- a/drivers/cpufreq/exynos5250-cpufreq.c
+++ b/drivers/cpufreq/exynos5250-cpufreq.c
@@ -153,7 +153,7 @@ int exynos5250_cpufreq_init(struct exynos_dvfs_info *info)
153 * dependencies on platform headers. It is necessary to enable 153 * dependencies on platform headers. It is necessary to enable
154 * Exynos multi-platform support and will be removed together with 154 * Exynos multi-platform support and will be removed together with
155 * this whole driver as soon as Exynos gets migrated to use 155 * this whole driver as soon as Exynos gets migrated to use
156 * cpufreq-cpu0 driver. 156 * cpufreq-dt driver.
157 */ 157 */
158 np = of_find_compatible_node(NULL, NULL, "samsung,exynos5250-clock"); 158 np = of_find_compatible_node(NULL, NULL, "samsung,exynos5250-clock");
159 if (!np) { 159 if (!np) {
diff --git a/drivers/cpufreq/highbank-cpufreq.c b/drivers/cpufreq/highbank-cpufreq.c
index bf8902a0866d..ec399ad2f059 100644
--- a/drivers/cpufreq/highbank-cpufreq.c
+++ b/drivers/cpufreq/highbank-cpufreq.c
@@ -6,7 +6,7 @@
6 * published by the Free Software Foundation. 6 * published by the Free Software Foundation.
7 * 7 *
8 * This driver provides the clk notifier callbacks that are used when 8 * This driver provides the clk notifier callbacks that are used when
9 * the cpufreq-cpu0 driver changes to frequency to alert the highbank 9 * the cpufreq-dt driver changes to frequency to alert the highbank
10 * EnergyCore Management Engine (ECME) about the need to change 10 * EnergyCore Management Engine (ECME) about the need to change
11 * voltage. The ECME interfaces with the actual voltage regulators. 11 * voltage. The ECME interfaces with the actual voltage regulators.
12 */ 12 */
@@ -60,7 +60,7 @@ static struct notifier_block hb_cpufreq_clk_nb = {
60 60
61static int hb_cpufreq_driver_init(void) 61static int hb_cpufreq_driver_init(void)
62{ 62{
63 struct platform_device_info devinfo = { .name = "cpufreq-cpu0", }; 63 struct platform_device_info devinfo = { .name = "cpufreq-dt", };
64 struct device *cpu_dev; 64 struct device *cpu_dev;
65 struct clk *cpu_clk; 65 struct clk *cpu_clk;
66 struct device_node *np; 66 struct device_node *np;
@@ -95,7 +95,7 @@ static int hb_cpufreq_driver_init(void)
95 goto out_put_node; 95 goto out_put_node;
96 } 96 }
97 97
98 /* Instantiate cpufreq-cpu0 */ 98 /* Instantiate cpufreq-dt */
99 platform_device_register_full(&devinfo); 99 platform_device_register_full(&devinfo);
100 100
101out_put_node: 101out_put_node:
diff --git a/drivers/cpufreq/s5pv210-cpufreq.c b/drivers/cpufreq/s5pv210-cpufreq.c
index 3f9791f07b8e..567caa6313ff 100644
--- a/drivers/cpufreq/s5pv210-cpufreq.c
+++ b/drivers/cpufreq/s5pv210-cpufreq.c
@@ -597,7 +597,7 @@ static int s5pv210_cpufreq_probe(struct platform_device *pdev)
597 * and dependencies on platform headers. It is necessary to enable 597 * and dependencies on platform headers. It is necessary to enable
598 * S5PV210 multi-platform support and will be removed together with 598 * S5PV210 multi-platform support and will be removed together with
599 * this whole driver as soon as S5PV210 gets migrated to use 599 * this whole driver as soon as S5PV210 gets migrated to use
600 * cpufreq-cpu0 driver. 600 * cpufreq-dt driver.
601 */ 601 */
602 np = of_find_compatible_node(NULL, NULL, "samsung,s5pv210-clock"); 602 np = of_find_compatible_node(NULL, NULL, "samsung,s5pv210-clock");
603 if (!np) { 603 if (!np) {