]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/arm/mach-omap2/board-n800-mmc.c
ARM: OMAP: Clean up header file duplication
[linux-2.6-omap-h63xx.git] / arch / arm / mach-omap2 / board-n800-mmc.c
index 26f3709a16fa81a90301e166ce716247d09f5af0..bcee07d537e0f7e654384bce11a4b7d58e279071 100644 (file)
@@ -9,14 +9,16 @@
  * published by the Free Software Foundation.
  */
 
-#include <asm/arch/mmc.h>
-#include <asm/arch/menelaus.h>
-#include <asm/arch/gpio.h>
+#include <linux/delay.h>
+#include <linux/platform_device.h>
+#include <linux/i2c/menelaus.h>
 
 #include <asm/mach-types.h>
-#include <linux/delay.h>
 
-#ifdef CONFIG_MMC_OMAP
+#include <mach/mmc.h>
+#include <mach/gpio.h>
+
+#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE)
 
 static const int slot_switch_gpio = 96;
 
@@ -293,17 +295,22 @@ static void n800_mmc_cleanup(struct device *dev)
        }
 }
 
-static struct omap_mmc_platform_data n800_mmc_data = {
+/*
+ * MMC controller1 has two slots that are multiplexed via I2C.
+ * MMC controller2 is not in use.
+ */
+static struct omap_mmc_platform_data mmc1_data = {
        .nr_slots               = 2,
        .switch_slot            = n800_mmc_switch_slot,
        .init                   = n800_mmc_late_init,
        .cleanup                = n800_mmc_cleanup,
        .shutdown               = n800_mmc_shutdown,
        .max_freq               = 24000000,
+       .dma_mask               = 0xffffffff,
        .slots[0] = {
+               .wire4          = 1,
                .set_power      = n800_mmc_set_power,
                .set_bus_mode   = n800_mmc_set_bus_mode,
-               .get_ro         = NULL,
                .get_cover_state= n800_mmc_get_cover_state,
                .ocr_mask       = MMC_VDD_165_195 | MMC_VDD_30_31 |
                                  MMC_VDD_32_33   | MMC_VDD_33_34,
@@ -312,7 +319,6 @@ static struct omap_mmc_platform_data n800_mmc_data = {
        .slots[1] = {
                .set_power      = n800_mmc_set_power,
                .set_bus_mode   = n800_mmc_set_bus_mode,
-               .get_ro         = NULL,
                .get_cover_state= n800_mmc_get_cover_state,
                .ocr_mask       = MMC_VDD_165_195 | MMC_VDD_20_21 |
                                  MMC_VDD_21_22 | MMC_VDD_22_23 | MMC_VDD_23_24 |
@@ -323,11 +329,13 @@ static struct omap_mmc_platform_data n800_mmc_data = {
        },
 };
 
+static struct omap_mmc_platform_data *mmc_data[OMAP24XX_NR_MMC];
+
 void __init n800_mmc_init(void)
 
 {
        if (machine_is_nokia_n810()) {
-               n800_mmc_data.slots[0].name = "external";
+               n800_mmc1_data.slots[0].name = "external";
 
                /*
                 * Some Samsung Movinand chips do not like open-ended
@@ -335,11 +343,10 @@ void __init n800_mmc_init(void)
                 * while doing so. Reducing the number of blocks in
                 * the transfer or delays in clock disable do not help
                 */
-               n800_mmc_data.slots[1].name = "internal";
-               n800_mmc_data.slots[1].ban_openended = 1;
+               n800_mmc1_data.slots[1].name = "internal";
+               n800_mmc1_data.slots[1].ban_openended = 1;
        }
 
-       omap_set_mmc_info(1, &n800_mmc_data);
        if (omap_request_gpio(slot_switch_gpio) < 0)
                BUG();
        omap_set_gpio_dataout(slot_switch_gpio, 0);
@@ -356,6 +363,9 @@ void __init n800_mmc_init(void)
                omap_set_gpio_dataout(n810_slot2_pw_vdd, 0);
                omap_set_gpio_direction(n810_slot2_pw_vdd, 0);
        }
+
+       mmc_data[0] = &mmc1_data;
+       omap2_init_mmc(mmc_data, OMAP24XX_NR_MMC);
 }
 #else