diff options
author | Benoit Cousson <b-cousson@ti.com> | 2011-08-16 09:02:20 -0400 |
---|---|---|
committer | Kevin Hilman <khilman@ti.com> | 2011-10-04 12:52:22 -0400 |
commit | 0f7aa005c85917f114c376e937d88f5d941fb389 (patch) | |
tree | 2cbfb7a5218d06b8520c9dbaf95e204003ae347e /arch | |
parent | b1621fc80123e4f113c3dc1bc6dbad53ebd0c888 (diff) |
ARM: OMAP2+: pm: Use hwmod name instead of dev pointer
Replace the struct device parameter of omap2_set_init_voltage
by the hwmod name. It will avoid having to store explicitely
the device pointer into a static variable.
Moreover, it will be a little bit more scalable if we introduce
new DVFS devices.
Signed-off-by: Benoit Cousson <b-cousson@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-omap2/pm.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c index 0844e2ecfb4a..7c038ea42093 100644 --- a/arch/arm/mach-omap2/pm.c +++ b/arch/arm/mach-omap2/pm.c | |||
@@ -169,18 +169,26 @@ err: | |||
169 | * in the opp entry | 169 | * in the opp entry |
170 | */ | 170 | */ |
171 | static int __init omap2_set_init_voltage(char *vdd_name, char *clk_name, | 171 | static int __init omap2_set_init_voltage(char *vdd_name, char *clk_name, |
172 | struct device *dev) | 172 | const char *oh_name) |
173 | { | 173 | { |
174 | struct voltagedomain *voltdm; | 174 | struct voltagedomain *voltdm; |
175 | struct clk *clk; | 175 | struct clk *clk; |
176 | struct opp *opp; | 176 | struct opp *opp; |
177 | unsigned long freq, bootup_volt; | 177 | unsigned long freq, bootup_volt; |
178 | struct device *dev; | ||
178 | 179 | ||
179 | if (!vdd_name || !clk_name || !dev) { | 180 | if (!vdd_name || !clk_name || !oh_name) { |
180 | pr_err("%s: invalid parameters\n", __func__); | 181 | pr_err("%s: invalid parameters\n", __func__); |
181 | goto exit; | 182 | goto exit; |
182 | } | 183 | } |
183 | 184 | ||
185 | dev = omap_device_get_by_hwmod_name(oh_name); | ||
186 | if (IS_ERR(dev)) { | ||
187 | pr_err("%s: Unable to get dev pointer for hwmod %s\n", | ||
188 | __func__, oh_name); | ||
189 | goto exit; | ||
190 | } | ||
191 | |||
184 | voltdm = voltdm_lookup(vdd_name); | 192 | voltdm = voltdm_lookup(vdd_name); |
185 | if (IS_ERR(voltdm)) { | 193 | if (IS_ERR(voltdm)) { |
186 | pr_err("%s: unable to get vdd pointer for vdd_%s\n", | 194 | pr_err("%s: unable to get vdd pointer for vdd_%s\n", |
@@ -224,8 +232,8 @@ static void __init omap3_init_voltages(void) | |||
224 | if (!cpu_is_omap34xx()) | 232 | if (!cpu_is_omap34xx()) |
225 | return; | 233 | return; |
226 | 234 | ||
227 | omap2_set_init_voltage("mpu_iva", "dpll1_ck", mpu_dev); | 235 | omap2_set_init_voltage("mpu_iva", "dpll1_ck", "mpu"); |
228 | omap2_set_init_voltage("core", "l3_ick", l3_dev); | 236 | omap2_set_init_voltage("core", "l3_ick", "l3_main"); |
229 | } | 237 | } |
230 | 238 | ||
231 | static void __init omap4_init_voltages(void) | 239 | static void __init omap4_init_voltages(void) |
@@ -233,9 +241,9 @@ static void __init omap4_init_voltages(void) | |||
233 | if (!cpu_is_omap44xx()) | 241 | if (!cpu_is_omap44xx()) |
234 | return; | 242 | return; |
235 | 243 | ||
236 | omap2_set_init_voltage("mpu", "dpll_mpu_ck", mpu_dev); | 244 | omap2_set_init_voltage("mpu", "dpll_mpu_ck", "mpu"); |
237 | omap2_set_init_voltage("core", "l3_div_ck", l3_dev); | 245 | omap2_set_init_voltage("core", "l3_div_ck", "l3_main_1"); |
238 | omap2_set_init_voltage("iva", "dpll_iva_m5x2_ck", iva_dev); | 246 | omap2_set_init_voltage("iva", "dpll_iva_m5x2_ck", "iva"); |
239 | } | 247 | } |
240 | 248 | ||
241 | static int __init omap2_common_pm_init(void) | 249 | static int __init omap2_common_pm_init(void) |