aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq
diff options
context:
space:
mode:
authorSudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>2013-10-29 08:18:39 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-10-29 19:48:26 -0400
commit47ac9aa165540b43deb3582f186073884de1cf3b (patch)
treeb191ae170496778588b34c8150015a7ac353d6a1 /drivers/cpufreq
parent4d910d5bb56c870e5a737b71d4130ec38dc4faea (diff)
cpufreq: arm_big_little: add vexpress SPC interface driver
The TC2(i.e. CA15_A7) Versatile Express has external Cortex M3 based power controller which is responsible for CPU DVFS and SPC provides the interface for the same. This patch adds a tiny interface driver to check if OPPs are initialised by SPC platform code and register the arm_big_little cpufreq driver. Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com> Acked-by: Nicolas Pitre <nico@linaro.org> Acked-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/Kconfig.arm8
-rw-r--r--drivers/cpufreq/Makefile1
-rw-r--r--drivers/cpufreq/vexpress-spc-cpufreq.c70
3 files changed, 79 insertions, 0 deletions
diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm
index 701ec95ce954..ce52ed949249 100644
--- a/drivers/cpufreq/Kconfig.arm
+++ b/drivers/cpufreq/Kconfig.arm
@@ -224,3 +224,11 @@ config ARM_TEGRA_CPUFREQ
224 default y 224 default y
225 help 225 help
226 This adds the CPUFreq driver support for TEGRA SOCs. 226 This adds the CPUFreq driver support for TEGRA SOCs.
227
228config ARM_VEXPRESS_SPC_CPUFREQ
229 tristate "Versatile Express SPC based CPUfreq driver"
230 select ARM_BIG_LITTLE_CPUFREQ
231 depends on ARCH_VEXPRESS_SPC
232 help
233 This add the CPUfreq driver support for Versatile Express
234 big.LITTLE platforms using SPC for power management.
diff --git a/drivers/cpufreq/Makefile b/drivers/cpufreq/Makefile
index b7948bbbbf1f..74945652dd7a 100644
--- a/drivers/cpufreq/Makefile
+++ b/drivers/cpufreq/Makefile
@@ -74,6 +74,7 @@ obj-$(CONFIG_ARM_SA1100_CPUFREQ) += sa1100-cpufreq.o
74obj-$(CONFIG_ARM_SA1110_CPUFREQ) += sa1110-cpufreq.o 74obj-$(CONFIG_ARM_SA1110_CPUFREQ) += sa1110-cpufreq.o
75obj-$(CONFIG_ARM_SPEAR_CPUFREQ) += spear-cpufreq.o 75obj-$(CONFIG_ARM_SPEAR_CPUFREQ) += spear-cpufreq.o
76obj-$(CONFIG_ARM_TEGRA_CPUFREQ) += tegra-cpufreq.o 76obj-$(CONFIG_ARM_TEGRA_CPUFREQ) += tegra-cpufreq.o
77obj-$(CONFIG_ARM_VEXPRESS_SPC_CPUFREQ) += vexpress-spc-cpufreq.o
77 78
78################################################################################## 79##################################################################################
79# PowerPC platform drivers 80# PowerPC platform drivers
diff --git a/drivers/cpufreq/vexpress-spc-cpufreq.c b/drivers/cpufreq/vexpress-spc-cpufreq.c
new file mode 100644
index 000000000000..7f7c9c01b44e
--- /dev/null
+++ b/drivers/cpufreq/vexpress-spc-cpufreq.c
@@ -0,0 +1,70 @@
1/*
2 * Versatile Express SPC CPUFreq Interface driver
3 *
4 * It provides necessary ops to arm_big_little cpufreq driver.
5 *
6 * Copyright (C) 2013 ARM Ltd.
7 * Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 *
13 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
14 * kind, whether express or implied; without even the implied warranty
15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 */
18
19#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
20
21#include <linux/cpufreq.h>
22#include <linux/module.h>
23#include <linux/platform_device.h>
24#include <linux/pm_opp.h>
25#include <linux/types.h>
26
27#include "arm_big_little.h"
28
29static int ve_spc_init_opp_table(struct device *cpu_dev)
30{
31 /*
32 * platform specific SPC code must initialise the opp table
33 * so just check if the OPP count is non-zero
34 */
35 return dev_pm_opp_get_opp_count(cpu_dev) <= 0;
36}
37
38static int ve_spc_get_transition_latency(struct device *cpu_dev)
39{
40 return 1000000; /* 1 ms */
41}
42
43static struct cpufreq_arm_bL_ops ve_spc_cpufreq_ops = {
44 .name = "vexpress-spc",
45 .get_transition_latency = ve_spc_get_transition_latency,
46 .init_opp_table = ve_spc_init_opp_table,
47};
48
49static int ve_spc_cpufreq_probe(struct platform_device *pdev)
50{
51 return bL_cpufreq_register(&ve_spc_cpufreq_ops);
52}
53
54static int ve_spc_cpufreq_remove(struct platform_device *pdev)
55{
56 bL_cpufreq_unregister(&ve_spc_cpufreq_ops);
57 return 0;
58}
59
60static struct platform_driver ve_spc_cpufreq_platdrv = {
61 .driver = {
62 .name = "vexpress-spc-cpufreq",
63 .owner = THIS_MODULE,
64 },
65 .probe = ve_spc_cpufreq_probe,
66 .remove = ve_spc_cpufreq_remove,
67};
68module_platform_driver(ve_spc_cpufreq_platdrv);
69
70MODULE_LICENSE("GPL");