diff options
author | Tony Lindgren <tony@atomide.com> | 2012-06-26 06:14:20 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2012-06-26 06:14:20 -0400 |
commit | b955eefc46a6923424cbede2f8ab76c8f5acf056 (patch) | |
tree | cb927c0108416095857131397031a7f8226e7d13 /arch/arm/mach-omap2/devices.c | |
parent | 5f7b9004297257e69212de89881979919d8e1adc (diff) |
ARM: OMAP2: Use hwmod to initialize mmc for 2420
This allows us to pass dma request lines in platform data to
MMC driver the same way as we already do for omap2430 and later.
Also note that we need to only build this code if MMC_OMAP
is selected, so change Makefile accordingly and place it near
the MMC_OMAP_HS in the Makefile.
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/devices.c')
-rw-r--r-- | arch/arm/mach-omap2/devices.c | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index 8cab358603ac..91ef6699df5e 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c | |||
@@ -27,7 +27,6 @@ | |||
27 | 27 | ||
28 | #include "iomap.h" | 28 | #include "iomap.h" |
29 | #include <plat/board.h> | 29 | #include <plat/board.h> |
30 | #include <plat/mmc.h> | ||
31 | #include <plat/dma.h> | 30 | #include <plat/dma.h> |
32 | #include <plat/omap_hwmod.h> | 31 | #include <plat/omap_hwmod.h> |
33 | #include <plat/omap_device.h> | 32 | #include <plat/omap_device.h> |
@@ -603,75 +602,6 @@ static inline void omap_init_aes(void) { } | |||
603 | 602 | ||
604 | /*-------------------------------------------------------------------------*/ | 603 | /*-------------------------------------------------------------------------*/ |
605 | 604 | ||
606 | #if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) | ||
607 | |||
608 | static inline void omap242x_mmc_mux(struct omap_mmc_platform_data | ||
609 | *mmc_controller) | ||
610 | { | ||
611 | if ((mmc_controller->slots[0].switch_pin > 0) && \ | ||
612 | (mmc_controller->slots[0].switch_pin < OMAP_MAX_GPIO_LINES)) | ||
613 | omap_mux_init_gpio(mmc_controller->slots[0].switch_pin, | ||
614 | OMAP_PIN_INPUT_PULLUP); | ||
615 | if ((mmc_controller->slots[0].gpio_wp > 0) && \ | ||
616 | (mmc_controller->slots[0].gpio_wp < OMAP_MAX_GPIO_LINES)) | ||
617 | omap_mux_init_gpio(mmc_controller->slots[0].gpio_wp, | ||
618 | OMAP_PIN_INPUT_PULLUP); | ||
619 | |||
620 | omap_mux_init_signal("sdmmc_cmd", 0); | ||
621 | omap_mux_init_signal("sdmmc_clki", 0); | ||
622 | omap_mux_init_signal("sdmmc_clko", 0); | ||
623 | omap_mux_init_signal("sdmmc_dat0", 0); | ||
624 | omap_mux_init_signal("sdmmc_dat_dir0", 0); | ||
625 | omap_mux_init_signal("sdmmc_cmd_dir", 0); | ||
626 | if (mmc_controller->slots[0].caps & MMC_CAP_4_BIT_DATA) { | ||
627 | omap_mux_init_signal("sdmmc_dat1", 0); | ||
628 | omap_mux_init_signal("sdmmc_dat2", 0); | ||
629 | omap_mux_init_signal("sdmmc_dat3", 0); | ||
630 | omap_mux_init_signal("sdmmc_dat_dir1", 0); | ||
631 | omap_mux_init_signal("sdmmc_dat_dir2", 0); | ||
632 | omap_mux_init_signal("sdmmc_dat_dir3", 0); | ||
633 | } | ||
634 | |||
635 | /* | ||
636 | * Use internal loop-back in MMC/SDIO Module Input Clock | ||
637 | * selection | ||
638 | */ | ||
639 | if (mmc_controller->slots[0].internal_clock) { | ||
640 | u32 v = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0); | ||
641 | v |= (1 << 24); | ||
642 | omap_ctrl_writel(v, OMAP2_CONTROL_DEVCONF0); | ||
643 | } | ||
644 | } | ||
645 | |||
646 | void __init omap242x_init_mmc(struct omap_mmc_platform_data **mmc_data) | ||
647 | { | ||
648 | struct platform_device *pdev; | ||
649 | struct omap_hwmod *oh; | ||
650 | int id = 0; | ||
651 | char *oh_name = "msdi1"; | ||
652 | char *dev_name = "mmci-omap"; | ||
653 | |||
654 | if (!mmc_data[0]) { | ||
655 | pr_err("%s fails: Incomplete platform data\n", __func__); | ||
656 | return; | ||
657 | } | ||
658 | |||
659 | omap242x_mmc_mux(mmc_data[0]); | ||
660 | |||
661 | oh = omap_hwmod_lookup(oh_name); | ||
662 | if (!oh) { | ||
663 | pr_err("Could not look up %s\n", oh_name); | ||
664 | return; | ||
665 | } | ||
666 | pdev = omap_device_build(dev_name, id, oh, mmc_data[0], | ||
667 | sizeof(struct omap_mmc_platform_data), NULL, 0, 0); | ||
668 | if (IS_ERR(pdev)) | ||
669 | WARN(1, "Can'd build omap_device for %s:%s.\n", | ||
670 | dev_name, oh->name); | ||
671 | } | ||
672 | |||
673 | #endif | ||
674 | |||
675 | #if defined(CONFIG_VIDEO_OMAP2_VOUT) || \ | 605 | #if defined(CONFIG_VIDEO_OMAP2_VOUT) || \ |
676 | defined(CONFIG_VIDEO_OMAP2_VOUT_MODULE) | 606 | defined(CONFIG_VIDEO_OMAP2_VOUT_MODULE) |
677 | #if defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE) | 607 | #if defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE) |