diff options
author | Shawn Guo <shawn.guo@linaro.org> | 2012-04-25 23:42:34 -0400 |
---|---|---|
committer | Shawn Guo <shawn.guo@linaro.org> | 2012-05-08 08:36:16 -0400 |
commit | 8321b758e08cae7fb02663f26efee4ba985c2ae5 (patch) | |
tree | 1a755f00abb35103c2c553eeb97616949faf91b6 /arch/arm/mach-imx/mach-mx51_efikamx.c | |
parent | bb13fabcca35fbce73f8cfbf238dacfa2a223006 (diff) |
ARM: imx: use machine specific hook for late init
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-imx/mach-mx51_efikamx.c')
-rw-r--r-- | arch/arm/mach-imx/mach-mx51_efikamx.c | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/arch/arm/mach-imx/mach-mx51_efikamx.c b/arch/arm/mach-imx/mach-mx51_efikamx.c index 586e9f822124..a9f3c7c5a1e0 100644 --- a/arch/arm/mach-imx/mach-mx51_efikamx.c +++ b/arch/arm/mach-imx/mach-mx51_efikamx.c | |||
@@ -207,29 +207,32 @@ static void mx51_efikamx_power_off(void) | |||
207 | 207 | ||
208 | static int __init mx51_efikamx_power_init(void) | 208 | static int __init mx51_efikamx_power_init(void) |
209 | { | 209 | { |
210 | if (machine_is_mx51_efikamx()) { | 210 | pwgt1 = regulator_get(NULL, "pwgt1"); |
211 | pwgt1 = regulator_get(NULL, "pwgt1"); | 211 | pwgt2 = regulator_get(NULL, "pwgt2"); |
212 | pwgt2 = regulator_get(NULL, "pwgt2"); | 212 | if (!IS_ERR(pwgt1) && !IS_ERR(pwgt2)) { |
213 | if (!IS_ERR(pwgt1) && !IS_ERR(pwgt2)) { | 213 | regulator_enable(pwgt1); |
214 | regulator_enable(pwgt1); | 214 | regulator_enable(pwgt2); |
215 | regulator_enable(pwgt2); | 215 | } |
216 | } | 216 | gpio_request(EFIKAMX_POWEROFF, "poweroff"); |
217 | gpio_request(EFIKAMX_POWEROFF, "poweroff"); | 217 | pm_power_off = mx51_efikamx_power_off; |
218 | pm_power_off = mx51_efikamx_power_off; | 218 | |
219 | 219 | /* enable coincell charger. maybe need a small power driver ? */ | |
220 | /* enable coincell charger. maybe need a small power driver ? */ | 220 | coincell = regulator_get(NULL, "coincell"); |
221 | coincell = regulator_get(NULL, "coincell"); | 221 | if (!IS_ERR(coincell)) { |
222 | if (!IS_ERR(coincell)) { | 222 | regulator_set_voltage(coincell, 3000000, 3000000); |
223 | regulator_set_voltage(coincell, 3000000, 3000000); | 223 | regulator_enable(coincell); |
224 | regulator_enable(coincell); | ||
225 | } | ||
226 | |||
227 | regulator_has_full_constraints(); | ||
228 | } | 224 | } |
229 | 225 | ||
226 | regulator_has_full_constraints(); | ||
227 | |||
230 | return 0; | 228 | return 0; |
231 | } | 229 | } |
232 | late_initcall(mx51_efikamx_power_init); | 230 | |
231 | static void __init mx51_efikamx_init_late(void) | ||
232 | { | ||
233 | imx51_init_late(); | ||
234 | mx51_efikamx_power_init(); | ||
235 | } | ||
233 | 236 | ||
234 | static void __init mx51_efikamx_init(void) | 237 | static void __init mx51_efikamx_init(void) |
235 | { | 238 | { |
@@ -293,5 +296,6 @@ MACHINE_START(MX51_EFIKAMX, "Genesi EfikaMX nettop") | |||
293 | .handle_irq = imx51_handle_irq, | 296 | .handle_irq = imx51_handle_irq, |
294 | .timer = &mx51_efikamx_timer, | 297 | .timer = &mx51_efikamx_timer, |
295 | .init_machine = mx51_efikamx_init, | 298 | .init_machine = mx51_efikamx_init, |
299 | .init_late = mx51_efikamx_init_late, | ||
296 | .restart = mx51_efikamx_restart, | 300 | .restart = mx51_efikamx_restart, |
297 | MACHINE_END | 301 | MACHINE_END |