diff options
Diffstat (limited to 'arch/arm/mach-omap2/board-omap3beagle.c')
-rw-r--r-- | arch/arm/mach-omap2/board-omap3beagle.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c index 85c09a09c5e3..5a3800da903f 100644 --- a/arch/arm/mach-omap2/board-omap3beagle.c +++ b/arch/arm/mach-omap2/board-omap3beagle.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/input.h> | 24 | #include <linux/input.h> |
25 | #include <linux/gpio_keys.h> | 25 | #include <linux/gpio_keys.h> |
26 | #include <linux/opp.h> | 26 | #include <linux/opp.h> |
27 | #include <linux/cpu.h> | ||
27 | 28 | ||
28 | #include <linux/mtd/mtd.h> | 29 | #include <linux/mtd/mtd.h> |
29 | #include <linux/mtd/partitions.h> | 30 | #include <linux/mtd/partitions.h> |
@@ -447,27 +448,31 @@ static struct omap_board_mux board_mux[] __initdata = { | |||
447 | }; | 448 | }; |
448 | #endif | 449 | #endif |
449 | 450 | ||
450 | static void __init beagle_opp_init(void) | 451 | static int __init beagle_opp_init(void) |
451 | { | 452 | { |
452 | int r = 0; | 453 | int r = 0; |
453 | 454 | ||
454 | /* Initialize the omap3 opp table */ | 455 | if (!machine_is_omap3_beagle()) |
455 | if (omap3_opp_init()) { | 456 | return 0; |
457 | |||
458 | /* Initialize the omap3 opp table if not already created. */ | ||
459 | r = omap3_opp_init(); | ||
460 | if (IS_ERR_VALUE(r) && (r != -EEXIST)) { | ||
456 | pr_err("%s: opp default init failed\n", __func__); | 461 | pr_err("%s: opp default init failed\n", __func__); |
457 | return; | 462 | return r; |
458 | } | 463 | } |
459 | 464 | ||
460 | /* Custom OPP enabled for all xM versions */ | 465 | /* Custom OPP enabled for all xM versions */ |
461 | if (cpu_is_omap3630()) { | 466 | if (cpu_is_omap3630()) { |
462 | struct device *mpu_dev, *iva_dev; | 467 | struct device *mpu_dev, *iva_dev; |
463 | 468 | ||
464 | mpu_dev = omap_device_get_by_hwmod_name("mpu"); | 469 | mpu_dev = get_cpu_device(0); |
465 | iva_dev = omap_device_get_by_hwmod_name("iva"); | 470 | iva_dev = omap_device_get_by_hwmod_name("iva"); |
466 | 471 | ||
467 | if (IS_ERR(mpu_dev) || IS_ERR(iva_dev)) { | 472 | if (IS_ERR(mpu_dev) || IS_ERR(iva_dev)) { |
468 | pr_err("%s: Aiee.. no mpu/dsp devices? %p %p\n", | 473 | pr_err("%s: Aiee.. no mpu/dsp devices? %p %p\n", |
469 | __func__, mpu_dev, iva_dev); | 474 | __func__, mpu_dev, iva_dev); |
470 | return; | 475 | return -ENODEV; |
471 | } | 476 | } |
472 | /* Enable MPU 1GHz and lower opps */ | 477 | /* Enable MPU 1GHz and lower opps */ |
473 | r = opp_enable(mpu_dev, 800000000); | 478 | r = opp_enable(mpu_dev, 800000000); |
@@ -487,8 +492,9 @@ static void __init beagle_opp_init(void) | |||
487 | opp_disable(iva_dev, 660000000); | 492 | opp_disable(iva_dev, 660000000); |
488 | } | 493 | } |
489 | } | 494 | } |
490 | return; | 495 | return 0; |
491 | } | 496 | } |
497 | device_initcall(beagle_opp_init); | ||
492 | 498 | ||
493 | static void __init omap3_beagle_init(void) | 499 | static void __init omap3_beagle_init(void) |
494 | { | 500 | { |
@@ -526,8 +532,6 @@ static void __init omap3_beagle_init(void) | |||
526 | /* Ensure SDRC pins are mux'd for self-refresh */ | 532 | /* Ensure SDRC pins are mux'd for self-refresh */ |
527 | omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); | 533 | omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); |
528 | omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT); | 534 | omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT); |
529 | |||
530 | beagle_opp_init(); | ||
531 | } | 535 | } |
532 | 536 | ||
533 | MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board") | 537 | MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board") |