diff options
author | Kevin Hilman <khilman@ti.com> | 2012-09-06 17:03:08 -0400 |
---|---|---|
committer | Kevin Hilman <khilman@ti.com> | 2012-10-08 17:59:04 -0400 |
commit | 24d7b40a60cf19008334bcbcbd98da374d4d9c64 (patch) | |
tree | 4f2252f030dbfd9976026945af70f87c7c217196 /arch | |
parent | 747a7f64201b8ffa8654c8767c5f794fdfa4239e (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')
-rw-r--r-- | arch/arm/mach-omap2/opp.c | 23 | ||||
-rw-r--r-- | arch/arm/mach-omap2/pm.c | 11 | ||||
-rw-r--r-- | arch/arm/mach-omap2/twl-common.c | 2 |
3 files changed, 28 insertions, 8 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) { |
diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c index 939bd6f70b51..173c2be14d5d 100644 --- a/arch/arm/mach-omap2/pm.c +++ b/arch/arm/mach-omap2/pm.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/opp.h> | 16 | #include <linux/opp.h> |
17 | #include <linux/export.h> | 17 | #include <linux/export.h> |
18 | #include <linux/suspend.h> | 18 | #include <linux/suspend.h> |
19 | #include <linux/cpu.h> | ||
19 | 20 | ||
20 | #include <asm/system_misc.h> | 21 | #include <asm/system_misc.h> |
21 | 22 | ||
@@ -168,7 +169,15 @@ static int __init omap2_set_init_voltage(char *vdd_name, char *clk_name, | |||
168 | goto exit; | 169 | goto exit; |
169 | } | 170 | } |
170 | 171 | ||
171 | dev = omap_device_get_by_hwmod_name(oh_name); | 172 | if (!strncmp(oh_name, "mpu", 3)) |
173 | /* | ||
174 | * All current OMAPs share voltage rail and clock | ||
175 | * source, so CPU0 is used to represent the MPU-SS. | ||
176 | */ | ||
177 | dev = get_cpu_device(0); | ||
178 | else | ||
179 | dev = omap_device_get_by_hwmod_name(oh_name); | ||
180 | |||
172 | if (IS_ERR(dev)) { | 181 | if (IS_ERR(dev)) { |
173 | pr_err("%s: Unable to get dev pointer for hwmod %s\n", | 182 | pr_err("%s: Unable to get dev pointer for hwmod %s\n", |
174 | __func__, oh_name); | 183 | __func__, oh_name); |
diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-common.c index 45f77413c21d..3f5eaccf6d8f 100644 --- a/arch/arm/mach-omap2/twl-common.c +++ b/arch/arm/mach-omap2/twl-common.c | |||
@@ -158,7 +158,7 @@ static struct regulator_init_data omap3_vpll2_idata = { | |||
158 | }; | 158 | }; |
159 | 159 | ||
160 | static struct regulator_consumer_supply omap3_vdd1_supply[] = { | 160 | static struct regulator_consumer_supply omap3_vdd1_supply[] = { |
161 | REGULATOR_SUPPLY("vcc", "mpu.0"), | 161 | REGULATOR_SUPPLY("vcc", "cpu0"), |
162 | }; | 162 | }; |
163 | 163 | ||
164 | static struct regulator_consumer_supply omap3_vdd2_supply[] = { | 164 | static struct regulator_consumer_supply omap3_vdd2_supply[] = { |