aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/opp.c
diff options
context:
space:
mode:
authorKevin Hilman <khilman@ti.com>2012-09-06 17:03:08 -0400
committerKevin Hilman <khilman@ti.com>2012-10-08 17:59:04 -0400
commit24d7b40a60cf19008334bcbcbd98da374d4d9c64 (patch)
tree4f2252f030dbfd9976026945af70f87c7c217196 /arch/arm/mach-omap2/opp.c
parent747a7f64201b8ffa8654c8767c5f794fdfa4239e (diff)
ARM: OMAP2+: PM: MPU DVFS: use generic CPU device for MPU-SS
Currently, a dummy omap_device is created for the MPU sub-system so that a device node exists for MPU DVFS. Specifically, for the association of MPU OPPs to a device node, and so that a voltage regulator can be mapped to a device node. For drivers to get a handle to this device node, an OMAP-specific API has been used. However, the kernel already has device nodes for the CPU(s) in the system, so we can use those instead of an OMAP-specific dummy device and then drivers (like OMAP CPUfreq) can use generic APIs. To use the existing CPU device nodes, modify the OPP creation and regulator registration to use the CPU0 device node for registraion. NOTE: this patch always uses CPU0 as the device node. On all OMAPs today, MPU DVFS scales all CPUs together, so this will not be a problem, but this assumption will need to be changed if independently scalable CPUs are introduced. Cc: Paul Walmsley <paul@pwsan.com> Signed-off-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/opp.c')
-rw-r--r--arch/arm/mach-omap2/opp.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/arch/arm/mach-omap2/opp.c b/arch/arm/mach-omap2/opp.c
index 45ad7f74f356..58e16aef40bb 100644
--- a/arch/arm/mach-omap2/opp.c
+++ b/arch/arm/mach-omap2/opp.c
@@ -18,6 +18,7 @@
18 */ 18 */
19#include <linux/module.h> 19#include <linux/module.h>
20#include <linux/opp.h> 20#include <linux/opp.h>
21#include <linux/cpu.h>
21 22
22#include <plat/omap_device.h> 23#include <plat/omap_device.h>
23 24
@@ -62,13 +63,23 @@ int __init omap_init_opp_table(struct omap_opp_def *opp_def,
62 __func__, i); 63 __func__, i);
63 return -EINVAL; 64 return -EINVAL;
64 } 65 }
65 oh = omap_hwmod_lookup(opp_def->hwmod_name); 66
66 if (!oh || !oh->od) { 67 if (!strncmp(opp_def->hwmod_name, "mpu", 3)) {
67 pr_debug("%s: no hwmod or odev for %s, [%d] cannot add OPPs.\n", 68 /*
68 __func__, opp_def->hwmod_name, i); 69 * All current OMAPs share voltage rail and
69 continue; 70 * clock source, so CPU0 is used to represent
71 * the MPU-SS.
72 */
73 dev = get_cpu_device(0);
74 } else {
75 oh = omap_hwmod_lookup(opp_def->hwmod_name);
76 if (!oh || !oh->od) {
77 pr_debug("%s: no hwmod or odev for %s, [%d] cannot add OPPs.\n",
78 __func__, opp_def->hwmod_name, i);
79 continue;
80 }
81 dev = &oh->od->pdev->dev;
70 } 82 }
71 dev = &oh->od->pdev->dev;
72 83
73 r = opp_add(dev, opp_def->freq, opp_def->u_volt); 84 r = opp_add(dev, opp_def->freq, opp_def->u_volt);
74 if (r) { 85 if (r) {