]> rtime.felk.cvut.cz Git - can-eth-gw-linux.git/commitdiff
ARM: at91: add atmel-mci support for chips and boards which can use it
authorLudovic Desroches <ludovic.desroches@atmel.com>
Mon, 21 May 2012 10:23:27 +0000 (12:23 +0200)
committerNicolas Ferre <nicolas.ferre@atmel.com>
Mon, 2 Jul 2012 16:03:01 +0000 (18:03 +0200)
Since atmel-mci driver supports all atmel mci versions,
use it instead of the deprecated at91_mci driver.
Platform data and all related configuration are removed.

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
[nicolas.ferre@atmel.com: remove at91_mci platform data]
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
32 files changed:
arch/arm/mach-at91/at91rm9200_devices.c
arch/arm/mach-at91/at91sam9260_devices.c
arch/arm/mach-at91/at91sam9261_devices.c
arch/arm/mach-at91/at91sam9263.c
arch/arm/mach-at91/at91sam9263_devices.c
arch/arm/mach-at91/at91sam9rl_devices.c
arch/arm/mach-at91/board-afeb-9260v1.c
arch/arm/mach-at91/board-carmeva.c
arch/arm/mach-at91/board-cpu9krea.c
arch/arm/mach-at91/board-cpuat91.c
arch/arm/mach-at91/board-csb337.c
arch/arm/mach-at91/board-eb9200.c
arch/arm/mach-at91/board-ecbat91.c
arch/arm/mach-at91/board-eco920.c
arch/arm/mach-at91/board-flexibity.c
arch/arm/mach-at91/board-foxg20.c
arch/arm/mach-at91/board-kb9202.c
arch/arm/mach-at91/board-neocore926.c
arch/arm/mach-at91/board-picotux200.c
arch/arm/mach-at91/board-qil-a9260.c
arch/arm/mach-at91/board-rm9200dk.c
arch/arm/mach-at91/board-rm9200ek.c
arch/arm/mach-at91/board-rsi-ews.c
arch/arm/mach-at91/board-sam9-l9260.c
arch/arm/mach-at91/board-sam9260ek.c
arch/arm/mach-at91/board-sam9261ek.c
arch/arm/mach-at91/board-sam9263ek.c
arch/arm/mach-at91/board-sam9g20ek.c
arch/arm/mach-at91/board-sam9rlek.c
arch/arm/mach-at91/board-stamp9g20.c
arch/arm/mach-at91/board-usb-a926x.c
arch/arm/mach-at91/board-yl-9200.c

index e6b7d0533dd75dad4f6cee4f3458a2a6ddda6581..f6c09b8f5fc9b39bd100dd957ee87f7a5434c027 100644 (file)
@@ -294,9 +294,9 @@ void __init at91_add_device_cf(struct at91_cf_data *data) {}
  *  MMC / SD
  * -------------------------------------------------------------------- */
 
-#if defined(CONFIG_MMC_AT91) || defined(CONFIG_MMC_AT91_MODULE)
+#if IS_ENABLED(CONFIG_MMC_ATMELMCI)
 static u64 mmc_dmamask = DMA_BIT_MASK(32);
-static struct at91_mmc_data mmc_data;
+static struct mci_platform_data mmc_data;
 
 static struct resource mmc_resources[] = {
        [0] = {
@@ -312,7 +312,7 @@ static struct resource mmc_resources[] = {
 };
 
 static struct platform_device at91rm9200_mmc_device = {
-       .name           = "at91_mci",
+       .name           = "atmel_mci",
        .id             = -1,
        .dev            = {
                                .dma_mask               = &mmc_dmamask,
@@ -323,53 +323,69 @@ static struct platform_device at91rm9200_mmc_device = {
        .num_resources  = ARRAY_SIZE(mmc_resources),
 };
 
-void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data)
+void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data)
 {
+       unsigned int i;
+       unsigned int slot_count = 0;
+
        if (!data)
                return;
 
-       /* input/irq */
-       if (gpio_is_valid(data->det_pin)) {
-               at91_set_gpio_input(data->det_pin, 1);
-               at91_set_deglitch(data->det_pin, 1);
-       }
-       if (gpio_is_valid(data->wp_pin))
-               at91_set_gpio_input(data->wp_pin, 1);
-       if (gpio_is_valid(data->vcc_pin))
-               at91_set_gpio_output(data->vcc_pin, 0);
-
-       /* CLK */
-       at91_set_A_periph(AT91_PIN_PA27, 0);
+       for (i = 0; i < ATMCI_MAX_NR_SLOTS; i++) {
 
-       if (data->slot_b) {
-               /* CMD */
-               at91_set_B_periph(AT91_PIN_PA8, 1);
+               if (!data->slot[i].bus_width)
+                       continue;
 
-               /* DAT0, maybe DAT1..DAT3 */
-               at91_set_B_periph(AT91_PIN_PA9, 1);
-               if (data->wire4) {
-                       at91_set_B_periph(AT91_PIN_PA10, 1);
-                       at91_set_B_periph(AT91_PIN_PA11, 1);
-                       at91_set_B_periph(AT91_PIN_PA12, 1);
+               /* input/irq */
+               if (gpio_is_valid(data->slot[i].detect_pin)) {
+                       at91_set_gpio_input(data->slot[i].detect_pin, 1);
+                       at91_set_deglitch(data->slot[i].detect_pin, 1);
                }
-       } else {
-               /* CMD */
-               at91_set_A_periph(AT91_PIN_PA28, 1);
-
-               /* DAT0, maybe DAT1..DAT3 */
-               at91_set_A_periph(AT91_PIN_PA29, 1);
-               if (data->wire4) {
-                       at91_set_B_periph(AT91_PIN_PB3, 1);
-                       at91_set_B_periph(AT91_PIN_PB4, 1);
-                       at91_set_B_periph(AT91_PIN_PB5, 1);
+               if (gpio_is_valid(data->slot[i].wp_pin))
+                       at91_set_gpio_input(data->slot[i].wp_pin, 1);
+
+               switch (i) {
+               case 0:                                 /* slot A */
+                       /* CMD */
+                       at91_set_A_periph(AT91_PIN_PA28, 1);
+                       /* DAT0, maybe DAT1..DAT3 */
+                       at91_set_A_periph(AT91_PIN_PA29, 1);
+                       if (data->slot[i].bus_width == 4) {
+                               at91_set_B_periph(AT91_PIN_PB3, 1);
+                               at91_set_B_periph(AT91_PIN_PB4, 1);
+                               at91_set_B_periph(AT91_PIN_PB5, 1);
+                       }
+                       slot_count++;
+                       break;
+               case 1:                                 /* slot B */
+                       /* CMD */
+                       at91_set_B_periph(AT91_PIN_PA8, 1);
+                       /* DAT0, maybe DAT1..DAT3 */
+                       at91_set_B_periph(AT91_PIN_PA9, 1);
+                       if (data->slot[i].bus_width == 4) {
+                               at91_set_B_periph(AT91_PIN_PA10, 1);
+                               at91_set_B_periph(AT91_PIN_PA11, 1);
+                               at91_set_B_periph(AT91_PIN_PA12, 1);
+                       }
+                       slot_count++;
+                       break;
+               default:
+                       printk(KERN_ERR
+                              "AT91: SD/MMC slot %d not available\n", i);
+                       break;
+               }
+               if (slot_count) {
+                       /* CLK */
+                       at91_set_A_periph(AT91_PIN_PA27, 0);
+
+                       mmc_data = *data;
+                       platform_device_register(&at91rm9200_mmc_device);
                }
        }
 
-       mmc_data = *data;
-       platform_device_register(&at91rm9200_mmc_device);
 }
 #else
-void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) {}
+void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data) {}
 #endif
 
 
index 0ded951f785af1f31c7cba305f191a5f137ea096..95f8395f4ebb5a25be3dbfbbd62433fb36336256 100644 (file)
@@ -208,93 +208,11 @@ void __init at91_add_device_eth(struct macb_platform_data *data) {}
 #endif
 
 
-/* --------------------------------------------------------------------
- *  MMC / SD
- * -------------------------------------------------------------------- */
-
-#if defined(CONFIG_MMC_AT91) || defined(CONFIG_MMC_AT91_MODULE)
-static u64 mmc_dmamask = DMA_BIT_MASK(32);
-static struct at91_mmc_data mmc_data;
-
-static struct resource mmc_resources[] = {
-       [0] = {
-               .start  = AT91SAM9260_BASE_MCI,
-               .end    = AT91SAM9260_BASE_MCI + SZ_16K - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = AT91SAM9260_ID_MCI,
-               .end    = AT91SAM9260_ID_MCI,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device at91sam9260_mmc_device = {
-       .name           = "at91_mci",
-       .id             = -1,
-       .dev            = {
-                               .dma_mask               = &mmc_dmamask,
-                               .coherent_dma_mask      = DMA_BIT_MASK(32),
-                               .platform_data          = &mmc_data,
-       },
-       .resource       = mmc_resources,
-       .num_resources  = ARRAY_SIZE(mmc_resources),
-};
-
-void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data)
-{
-       if (!data)
-               return;
-
-       /* input/irq */
-       if (gpio_is_valid(data->det_pin)) {
-               at91_set_gpio_input(data->det_pin, 1);
-               at91_set_deglitch(data->det_pin, 1);
-       }
-       if (gpio_is_valid(data->wp_pin))
-               at91_set_gpio_input(data->wp_pin, 1);
-       if (gpio_is_valid(data->vcc_pin))
-               at91_set_gpio_output(data->vcc_pin, 0);
-
-       /* CLK */
-       at91_set_A_periph(AT91_PIN_PA8, 0);
-
-       if (data->slot_b) {
-               /* CMD */
-               at91_set_B_periph(AT91_PIN_PA1, 1);
-
-               /* DAT0, maybe DAT1..DAT3 */
-               at91_set_B_periph(AT91_PIN_PA0, 1);
-               if (data->wire4) {
-                       at91_set_B_periph(AT91_PIN_PA5, 1);
-                       at91_set_B_periph(AT91_PIN_PA4, 1);
-                       at91_set_B_periph(AT91_PIN_PA3, 1);
-               }
-       } else {
-               /* CMD */
-               at91_set_A_periph(AT91_PIN_PA7, 1);
-
-               /* DAT0, maybe DAT1..DAT3 */
-               at91_set_A_periph(AT91_PIN_PA6, 1);
-               if (data->wire4) {
-                       at91_set_A_periph(AT91_PIN_PA9, 1);
-                       at91_set_A_periph(AT91_PIN_PA10, 1);
-                       at91_set_A_periph(AT91_PIN_PA11, 1);
-               }
-       }
-
-       mmc_data = *data;
-       platform_device_register(&at91sam9260_mmc_device);
-}
-#else
-void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) {}
-#endif
-
 /* --------------------------------------------------------------------
  *  MMC / SD Slot for Atmel MCI Driver
  * -------------------------------------------------------------------- */
 
-#if defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_ATMELMCI_MODULE)
+#if IS_ENABLED(CONFIG_MMC_ATMELMCI)
 static u64 mmc_dmamask = DMA_BIT_MASK(32);
 static struct mci_platform_data mmc_data;
 
index 9295e90b08ff523fa93817ca9121eb15d9d5a2bb..5d9d4c876a4441af23f55fd8e91732561ca441d2 100644 (file)
@@ -137,9 +137,9 @@ void __init at91_add_device_udc(struct at91_udc_data *data) {}
  *  MMC / SD
  * -------------------------------------------------------------------- */
 
-#if defined(CONFIG_MMC_AT91) || defined(CONFIG_MMC_AT91_MODULE)
+#if IS_ENABLED(CONFIG_MMC_ATMELMCI)
 static u64 mmc_dmamask = DMA_BIT_MASK(32);
-static struct at91_mmc_data mmc_data;
+static struct mci_platform_data mmc_data;
 
 static struct resource mmc_resources[] = {
        [0] = {
@@ -155,7 +155,7 @@ static struct resource mmc_resources[] = {
 };
 
 static struct platform_device at91sam9261_mmc_device = {
-       .name           = "at91_mci",
+       .name           = "atmel_mci",
        .id             = -1,
        .dev            = {
                                .dma_mask               = &mmc_dmamask,
@@ -166,40 +166,40 @@ static struct platform_device at91sam9261_mmc_device = {
        .num_resources  = ARRAY_SIZE(mmc_resources),
 };
 
-void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data)
+void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data)
 {
        if (!data)
                return;
 
-       /* input/irq */
-       if (gpio_is_valid(data->det_pin)) {
-               at91_set_gpio_input(data->det_pin, 1);
-               at91_set_deglitch(data->det_pin, 1);
-       }
-       if (gpio_is_valid(data->wp_pin))
-               at91_set_gpio_input(data->wp_pin, 1);
-       if (gpio_is_valid(data->vcc_pin))
-               at91_set_gpio_output(data->vcc_pin, 0);
-
-       /* CLK */
-       at91_set_B_periph(AT91_PIN_PA2, 0);
-
-       /* CMD */
-       at91_set_B_periph(AT91_PIN_PA1, 1);
-
-       /* DAT0, maybe DAT1..DAT3 */
-       at91_set_B_periph(AT91_PIN_PA0, 1);
-       if (data->wire4) {
-               at91_set_B_periph(AT91_PIN_PA4, 1);
-               at91_set_B_periph(AT91_PIN_PA5, 1);
-               at91_set_B_periph(AT91_PIN_PA6, 1);
-       }
+       if (data->slot[0].bus_width) {
+               /* input/irq */
+               if (gpio_is_valid(data->slot[0].detect_pin)) {
+                       at91_set_gpio_input(data->slot[0].detect_pin, 1);
+                       at91_set_deglitch(data->slot[0].detect_pin, 1);
+               }
+               if (gpio_is_valid(data->slot[0].wp_pin))
+                       at91_set_gpio_input(data->slot[0].wp_pin, 1);
+
+               /* CLK */
+               at91_set_B_periph(AT91_PIN_PA2, 0);
 
-       mmc_data = *data;
-       platform_device_register(&at91sam9261_mmc_device);
+               /* CMD */
+               at91_set_B_periph(AT91_PIN_PA1, 1);
+
+               /* DAT0, maybe DAT1..DAT3 */
+               at91_set_B_periph(AT91_PIN_PA0, 1);
+               if (data->slot[0].bus_width == 4) {
+                       at91_set_B_periph(AT91_PIN_PA4, 1);
+                       at91_set_B_periph(AT91_PIN_PA5, 1);
+                       at91_set_B_periph(AT91_PIN_PA6, 1);
+               }
+
+               mmc_data = *data;
+               platform_device_register(&at91sam9261_mmc_device);
+       }
 }
 #else
-void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) {}
+void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data) {}
 #endif
 
 
index ed91c7e9f7c20312ccc9f25564187c84f8e118af..7ccf6d0c2427a1bba3484276b98827caeece7a9b 100644 (file)
@@ -187,8 +187,8 @@ static struct clk_lookup periph_clocks_lookups[] = {
        CLKDEV_CON_ID("hclk", &macb_clk),
        CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk),
        CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk),
-       CLKDEV_CON_DEV_ID("mci_clk", "at91_mci.0", &mmc0_clk),
-       CLKDEV_CON_DEV_ID("mci_clk", "at91_mci.1", &mmc1_clk),
+       CLKDEV_CON_DEV_ID("mci_clk", "atmel_mci.0", &mmc0_clk),
+       CLKDEV_CON_DEV_ID("mci_clk", "atmel_mci.1", &mmc1_clk),
        CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.0", &spi0_clk),
        CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk),
        CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tcb_clk),
index 175e0009eaa9b886a90694dcf5cb1d880e2e38ad..aa15997ec9ebb5cfb1e7395705f0e0ca065cdf50 100644 (file)
@@ -218,9 +218,9 @@ void __init at91_add_device_eth(struct macb_platform_data *data) {}
  *  MMC / SD
  * -------------------------------------------------------------------- */
 
-#if defined(CONFIG_MMC_AT91) || defined(CONFIG_MMC_AT91_MODULE)
+#if IS_ENABLED(CONFIG_MMC_ATMELMCI)
 static u64 mmc_dmamask = DMA_BIT_MASK(32);
-static struct at91_mmc_data mmc0_data, mmc1_data;
+static struct mci_platform_data mmc0_data, mmc1_data;
 
 static struct resource mmc0_resources[] = {
        [0] = {
@@ -236,7 +236,7 @@ static struct resource mmc0_resources[] = {
 };
 
 static struct platform_device at91sam9263_mmc0_device = {
-       .name           = "at91_mci",
+       .name           = "atmel_mci",
        .id             = 0,
        .dev            = {
                                .dma_mask               = &mmc_dmamask,
@@ -261,7 +261,7 @@ static struct resource mmc1_resources[] = {
 };
 
 static struct platform_device at91sam9263_mmc1_device = {
-       .name           = "at91_mci",
+       .name           = "atmel_mci",
        .id             = 1,
        .dev            = {
                                .dma_mask               = &mmc_dmamask,
@@ -272,85 +272,110 @@ static struct platform_device at91sam9263_mmc1_device = {
        .num_resources  = ARRAY_SIZE(mmc1_resources),
 };
 
-void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data)
+void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data)
 {
+       unsigned int i;
+       unsigned int slot_count = 0;
+
        if (!data)
                return;
 
-       /* input/irq */
-       if (gpio_is_valid(data->det_pin)) {
-               at91_set_gpio_input(data->det_pin, 1);
-               at91_set_deglitch(data->det_pin, 1);
-       }
-       if (gpio_is_valid(data->wp_pin))
-               at91_set_gpio_input(data->wp_pin, 1);
-       if (gpio_is_valid(data->vcc_pin))
-               at91_set_gpio_output(data->vcc_pin, 0);
+       for (i = 0; i < ATMCI_MAX_NR_SLOTS; i++) {
 
-       if (mmc_id == 0) {              /* MCI0 */
-               /* CLK */
-               at91_set_A_periph(AT91_PIN_PA12, 0);
+               if (!data->slot[i].bus_width)
+                       continue;
 
-               if (data->slot_b) {
-                       /* CMD */
-                       at91_set_A_periph(AT91_PIN_PA16, 1);
+               /* input/irq */
+               if (gpio_is_valid(data->slot[i].detect_pin)) {
+                       at91_set_gpio_input(data->slot[i].detect_pin,
+                                       1);
+                       at91_set_deglitch(data->slot[i].detect_pin,
+                                       1);
+               }
+               if (gpio_is_valid(data->slot[i].wp_pin))
+                       at91_set_gpio_input(data->slot[i].wp_pin, 1);
+
+               if (mmc_id == 0) {                              /* MCI0 */
+                       switch (i) {
+                       case 0:                                 /* slot A */
+                               /* CMD */
+                               at91_set_A_periph(AT91_PIN_PA1, 1);
+                               /* DAT0, maybe DAT1..DAT3 */
+                               at91_set_A_periph(AT91_PIN_PA0, 1);
+                               if (data->slot[i].bus_width == 4) {
+                                       at91_set_A_periph(AT91_PIN_PA3, 1);
+                                       at91_set_A_periph(AT91_PIN_PA4, 1);
+                                       at91_set_A_periph(AT91_PIN_PA5, 1);
+                               }
+                               slot_count++;
+                               break;
+                       case 1:                                 /* slot B */
+                               /* CMD */
+                               at91_set_A_periph(AT91_PIN_PA16, 1);
+                               /* DAT0, maybe DAT1..DAT3 */
+                               at91_set_A_periph(AT91_PIN_PA17, 1);
+                               if (data->slot[i].bus_width == 4) {
+                                       at91_set_A_periph(AT91_PIN_PA18, 1);
+                                       at91_set_A_periph(AT91_PIN_PA19, 1);
+                                       at91_set_A_periph(AT91_PIN_PA20, 1);
+                               }
+                               slot_count++;
+                               break;
+                       default:
+                               printk(KERN_ERR
+                                      "AT91: SD/MMC slot %d not available\n", i);
+                               break;
+                       }
+                       if (slot_count) {
+                               /* CLK */
+                               at91_set_A_periph(AT91_PIN_PA12, 0);
 
-                       /* DAT0, maybe DAT1..DAT3 */
-                       at91_set_A_periph(AT91_PIN_PA17, 1);
-                       if (data->wire4) {
-                               at91_set_A_periph(AT91_PIN_PA18, 1);
-                               at91_set_A_periph(AT91_PIN_PA19, 1);
-                               at91_set_A_periph(AT91_PIN_PA20, 1);
+                               mmc0_data = *data;
+                               platform_device_register(&at91sam9263_mmc0_device);
                        }
-               } else {
-                       /* CMD */
-                       at91_set_A_periph(AT91_PIN_PA1, 1);
-
-                       /* DAT0, maybe DAT1..DAT3 */
-                       at91_set_A_periph(AT91_PIN_PA0, 1);
-                       if (data->wire4) {
-                               at91_set_A_periph(AT91_PIN_PA3, 1);
-                               at91_set_A_periph(AT91_PIN_PA4, 1);
-                               at91_set_A_periph(AT91_PIN_PA5, 1);
+               } else if (mmc_id == 1) {                       /* MCI1 */
+                       switch (i) {
+                       case 0:                                 /* slot A */
+                               /* CMD */
+                               at91_set_A_periph(AT91_PIN_PA7, 1);
+                               /* DAT0, maybe DAT1..DAT3 */
+                               at91_set_A_periph(AT91_PIN_PA8, 1);
+                               if (data->slot[i].bus_width == 4) {
+                                       at91_set_A_periph(AT91_PIN_PA9, 1);
+                                       at91_set_A_periph(AT91_PIN_PA10, 1);
+                                       at91_set_A_periph(AT91_PIN_PA11, 1);
+                               }
+                               slot_count++;
+                               break;
+                       case 1:                                 /* slot B */
+                               /* CMD */
+                               at91_set_A_periph(AT91_PIN_PA21, 1);
+                               /* DAT0, maybe DAT1..DAT3 */
+                               at91_set_A_periph(AT91_PIN_PA22, 1);
+                               if (data->slot[i].bus_width == 4) {
+                                       at91_set_A_periph(AT91_PIN_PA23, 1);
+                                       at91_set_A_periph(AT91_PIN_PA24, 1);
+                                       at91_set_A_periph(AT91_PIN_PA25, 1);
+                               }
+                               slot_count++;
+                               break;
+                       default:
+                               printk(KERN_ERR
+                                      "AT91: SD/MMC slot %d not available\n", i);
+                               break;
                        }
-               }
+                       if (slot_count) {
+                               /* CLK */
+                               at91_set_A_periph(AT91_PIN_PA6, 0);
 
-               mmc0_data = *data;
-               platform_device_register(&at91sam9263_mmc0_device);
-       } else {                        /* MCI1 */
-               /* CLK */
-               at91_set_A_periph(AT91_PIN_PA6, 0);
-
-               if (data->slot_b) {
-                       /* CMD */
-                       at91_set_A_periph(AT91_PIN_PA21, 1);
-
-                       /* DAT0, maybe DAT1..DAT3 */
-                       at91_set_A_periph(AT91_PIN_PA22, 1);
-                       if (data->wire4) {
-                               at91_set_A_periph(AT91_PIN_PA23, 1);
-                               at91_set_A_periph(AT91_PIN_PA24, 1);
-                               at91_set_A_periph(AT91_PIN_PA25, 1);
-                       }
-               } else {
-                       /* CMD */
-                       at91_set_A_periph(AT91_PIN_PA7, 1);
-
-                       /* DAT0, maybe DAT1..DAT3 */
-                       at91_set_A_periph(AT91_PIN_PA8, 1);
-                       if (data->wire4) {
-                               at91_set_A_periph(AT91_PIN_PA9, 1);
-                               at91_set_A_periph(AT91_PIN_PA10, 1);
-                               at91_set_A_periph(AT91_PIN_PA11, 1);
+                               mmc1_data = *data;
+                               platform_device_register(&at91sam9263_mmc1_device);
                        }
                }
-
-               mmc1_data = *data;
-               platform_device_register(&at91sam9263_mmc1_device);
        }
 }
 #else
-void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) {}
+void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data) {}
 #endif
 
 /* --------------------------------------------------------------------
index 9c0b1481a9a70c5d3ac6ebfc199c5d2e77ba1f46..7359472f27649ab0cc1a7d152ca48076aafd2ada 100644 (file)
@@ -161,9 +161,9 @@ void __init at91_add_device_usba(struct usba_platform_data *data) {}
  *  MMC / SD
  * -------------------------------------------------------------------- */
 
-#if defined(CONFIG_MMC_AT91) || defined(CONFIG_MMC_AT91_MODULE)
+#if IS_ENABLED(CONFIG_MMC_ATMELMCI)
 static u64 mmc_dmamask = DMA_BIT_MASK(32);
-static struct at91_mmc_data mmc_data;
+static struct mci_platform_data mmc_data;
 
 static struct resource mmc_resources[] = {
        [0] = {
@@ -179,7 +179,7 @@ static struct resource mmc_resources[] = {
 };
 
 static struct platform_device at91sam9rl_mmc_device = {
-       .name           = "at91_mci",
+       .name           = "atmel_mci",
        .id             = -1,
        .dev            = {
                                .dma_mask               = &mmc_dmamask,
@@ -190,40 +190,40 @@ static struct platform_device at91sam9rl_mmc_device = {
        .num_resources  = ARRAY_SIZE(mmc_resources),
 };
 
-void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data)
+void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data)
 {
        if (!data)
                return;
 
-       /* input/irq */
-       if (gpio_is_valid(data->det_pin)) {
-               at91_set_gpio_input(data->det_pin, 1);
-               at91_set_deglitch(data->det_pin, 1);
-       }
-       if (gpio_is_valid(data->wp_pin))
-               at91_set_gpio_input(data->wp_pin, 1);
-       if (gpio_is_valid(data->vcc_pin))
-               at91_set_gpio_output(data->vcc_pin, 0);
-
-       /* CLK */
-       at91_set_A_periph(AT91_PIN_PA2, 0);
-
-       /* CMD */
-       at91_set_A_periph(AT91_PIN_PA1, 1);
-
-       /* DAT0, maybe DAT1..DAT3 */
-       at91_set_A_periph(AT91_PIN_PA0, 1);
-       if (data->wire4) {
-               at91_set_A_periph(AT91_PIN_PA3, 1);
-               at91_set_A_periph(AT91_PIN_PA4, 1);
-               at91_set_A_periph(AT91_PIN_PA5, 1);
+       if (data->slot[0].bus_width) {
+               /* input/irq */
+               if (gpio_is_valid(data->slot[0].detect_pin)) {
+                       at91_set_gpio_input(data->slot[0].detect_pin, 1);
+                       at91_set_deglitch(data->slot[0].detect_pin, 1);
+               }
+               if (gpio_is_valid(data->slot[0].wp_pin))
+                       at91_set_gpio_input(data->slot[0].wp_pin, 1);
+
+               /* CLK */
+               at91_set_A_periph(AT91_PIN_PA2, 0);
+
+               /* CMD */
+               at91_set_A_periph(AT91_PIN_PA1, 1);
+
+               /* DAT0, maybe DAT1..DAT3 */
+               at91_set_A_periph(AT91_PIN_PA0, 1);
+               if (data->slot[0].bus_width == 4) {
+                       at91_set_A_periph(AT91_PIN_PA3, 1);
+                       at91_set_A_periph(AT91_PIN_PA4, 1);
+                       at91_set_A_periph(AT91_PIN_PA5, 1);
+               }
+
+               mmc_data = *data;
+               platform_device_register(&at91sam9rl_mmc_device);
        }
-
-       mmc_data = *data;
-       platform_device_register(&at91sam9rl_mmc_device);
 }
 #else
-void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) {}
+void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data) {}
 #endif
 
 
index b7d8aa7b81e64baa60d6ea772a74a52c471d5228..e49907c25508688e25c853ccd7c9898baf89c1e6 100644 (file)
@@ -132,12 +132,12 @@ static struct atmel_nand_data __initdata afeb9260_nand_data = {
 /*
  * MCI (SD/MMC)
  */
-static struct at91_mmc_data __initdata afeb9260_mmc_data = {
-       .det_pin        = AT91_PIN_PC9,
-       .wp_pin         = AT91_PIN_PC4,
-       .slot_b         = 1,
-       .wire4          = 1,
-       .vcc_pin        = -EINVAL,
+static struct mci_platform_data __initdata afeb9260_mci0_data = {
+       .slot[1] = {
+               .bus_width      = 4,
+               .detect_pin     = AT91_PIN_PC9,
+               .wp_pin         = AT91_PIN_PC4,
+       },
 };
 
 
@@ -198,7 +198,7 @@ static void __init afeb9260_board_init(void)
        at91_set_B_periph(AT91_PIN_PA10, 0);    /* ETX2 */
        at91_set_B_periph(AT91_PIN_PA11, 0);    /* ETX3 */
        /* MMC */
-       at91_add_device_mmc(0, &afeb9260_mmc_data);
+       at91_add_device_mci(0, &afeb9260_mci0_data);
        /* I2C */
        at91_add_device_i2c(afeb9260_i2c_devices,
                        ARRAY_SIZE(afeb9260_i2c_devices));
index 44328a6d46095027b75f903a11b7ec611c9043f5..99e2de74429b50153c147de7979054394dc5acd8 100644 (file)
@@ -70,12 +70,12 @@ static struct at91_udc_data __initdata carmeva_udc_data = {
        // .vcc_pin     = -EINVAL,
 // };
 
-static struct at91_mmc_data __initdata carmeva_mmc_data = {
-       .slot_b         = 0,
-       .wire4          = 1,
-       .det_pin        = AT91_PIN_PB10,
-       .wp_pin         = AT91_PIN_PC14,
-       .vcc_pin        = -EINVAL,
+static struct mci_platform_data __initdata carmeva_mci0_data = {
+       .slot[0] = {
+               .bus_width      = 4,
+               .detect_pin     = AT91_PIN_PB10,
+               .wp_pin         = AT91_PIN_PC14,
+       },
 };
 
 static struct spi_board_info carmeva_spi_devices[] = {
@@ -149,7 +149,7 @@ static void __init carmeva_board_init(void)
        /* Compact Flash */
 //     at91_add_device_cf(&carmeva_cf_data);
        /* MMC */
-       at91_add_device_mmc(0, &carmeva_mmc_data);
+       at91_add_device_mci(0, &carmeva_mci0_data);
        /* LEDs */
        at91_gpio_leds(carmeva_leds, ARRAY_SIZE(carmeva_leds));
 }
index ece0d76fd0f86b4b0fd02d630465749d0c356508..202c3b99fda86c9578d89ef30ca20bf1c5e1d45d 100644 (file)
@@ -310,12 +310,12 @@ static void __init cpu9krea_add_device_buttons(void)
 /*
  * MCI (SD/MMC)
  */
-static struct at91_mmc_data __initdata cpu9krea_mmc_data = {
-       .slot_b         = 0,
-       .wire4          = 1,
-       .det_pin        = AT91_PIN_PA29,
-       .wp_pin         = -EINVAL,
-       .vcc_pin        = -EINVAL,
+static struct mci_platform_data __initdata cpu9krea_mci0_data = {
+       .slot[0] = {
+               .bus_width      = 4,
+               .detect_pin     = AT91_PIN_PA29,
+               .wp_pin         = -EINVAL,
+       },
 };
 
 static void __init cpu9krea_board_init(void)
@@ -357,7 +357,7 @@ static void __init cpu9krea_board_init(void)
        /* Ethernet */
        at91_add_device_eth(&cpu9krea_macb_data);
        /* MMC */
-       at91_add_device_mmc(0, &cpu9krea_mmc_data);
+       at91_add_device_mci(0, &cpu9krea_mci0_data);
        /* I2C */
        at91_add_device_i2c(cpu9krea_i2c_devices,
                ARRAY_SIZE(cpu9krea_i2c_devices));
index 895cf2dba612fe3a6c1ec0212ce7d1c45ff127cb..7f64920a41c013b74f76f3cf149ee59ad9901944 100644 (file)
@@ -77,11 +77,12 @@ static struct at91_udc_data __initdata cpuat91_udc_data = {
        .pullup_pin     = AT91_PIN_PC14,
 };
 
-static struct at91_mmc_data __initdata cpuat91_mmc_data = {
-       .det_pin        = AT91_PIN_PC2,
-       .wire4          = 1,
-       .wp_pin         = -EINVAL,
-       .vcc_pin        = -EINVAL,
+static struct mci_platform_data __initdata cpuat91_mci0_data = {
+       .slot[0] = {
+               .bus_width      = 4,
+               .detect_pin     = AT91_PIN_PC2,
+               .wp_pin         = -EINVAL,
+       },
 };
 
 static struct physmap_flash_data cpuat91_flash_data = {
@@ -167,7 +168,7 @@ static void __init cpuat91_board_init(void)
        /* USB Device */
        at91_add_device_udc(&cpuat91_udc_data);
        /* MMC */
-       at91_add_device_mmc(0, &cpuat91_mmc_data);
+       at91_add_device_mci(0, &cpuat91_mci0_data);
        /* I2C */
        at91_add_device_i2c(NULL, 0);
        /* Platform devices */
index cd813361cd26be2d61a49de0f536f3be0ac1059d..a17693540a1513e65867001f0eadd8589980f603 100644 (file)
@@ -86,12 +86,12 @@ static struct at91_cf_data __initdata csb337_cf_data = {
        .rst_pin        = AT91_PIN_PD2,
 };
 
-static struct at91_mmc_data __initdata csb337_mmc_data = {
-       .det_pin        = AT91_PIN_PD5,
-       .slot_b         = 0,
-       .wire4          = 1,
-       .wp_pin         = AT91_PIN_PD6,
-       .vcc_pin        = -EINVAL,
+static struct mci_platform_data __initdata csb337_mci0_data = {
+       .slot[0] = {
+               .bus_width      = 4,
+               .detect_pin     = AT91_PIN_PD5,
+               .wp_pin         = AT91_PIN_PD6,
+       },
 };
 
 static struct spi_board_info csb337_spi_devices[] = {
@@ -239,7 +239,7 @@ static void __init csb337_board_init(void)
        /* SPI */
        at91_add_device_spi(csb337_spi_devices, ARRAY_SIZE(csb337_spi_devices));
        /* MMC */
-       at91_add_device_mmc(0, &csb337_mmc_data);
+       at91_add_device_mci(0, &csb337_mci0_data);
        /* NOR flash */
        platform_device_register(&csb_flash);
        /* LEDs */
index bd10172979891c1aab6b139496b068500eedc30b..d9f4f75a1c0ab8183330170dae2397cecdee46c8 100644 (file)
@@ -69,12 +69,12 @@ static struct at91_cf_data __initdata eb9200_cf_data = {
        .rst_pin        = AT91_PIN_PC5,
 };
 
-static struct at91_mmc_data __initdata eb9200_mmc_data = {
-       .slot_b         = 0,
-       .wire4          = 1,
-       .det_pin        = -EINVAL,
-       .wp_pin         = -EINVAL,
-       .vcc_pin        = -EINVAL,
+static struct mci_platform_data __initdata eb9200_mci0_data = {
+       .slot[0] = {
+               .bus_width      = 4,
+               .detect_pin     = -EINVAL,
+               .wp_pin         = -EINVAL,
+       },
 };
 
 static struct i2c_board_info __initdata eb9200_i2c_devices[] = {
@@ -112,7 +112,7 @@ static void __init eb9200_board_init(void)
        at91_add_device_spi(NULL, 0);
        /* MMC */
        /* only supports 1 or 4 bit interface, not wired through to SPI */
-       at91_add_device_mmc(0, &eb9200_mmc_data);
+       at91_add_device_mci(0, &eb9200_mci0_data);
 }
 
 MACHINE_START(ATEB9200, "Embest ATEB9200")
index 89cc3726a9ce1f3b57f5c589b5d495d1a6c5d4db..086ec5b3ebe873ee999edad82f83bde92f51cf7a 100644 (file)
@@ -63,12 +63,12 @@ static struct at91_usbh_data __initdata ecb_at91usbh_data = {
        .overcurrent_pin= {-EINVAL, -EINVAL},
 };
 
-static struct at91_mmc_data __initdata ecb_at91mmc_data = {
-       .slot_b         = 0,
-       .wire4          = 1,
-       .det_pin        = -EINVAL,
-       .wp_pin         = -EINVAL,
-       .vcc_pin        = -EINVAL,
+static struct mci_platform_data __initdata ecbat91_mci0_data = {
+       .slot[0] = {
+               .bus_width      = 4,
+               .detect_pin     = -EINVAL,
+               .wp_pin         = -EINVAL,
+       },
 };
 
 
@@ -160,7 +160,7 @@ static void __init ecb_at91board_init(void)
        at91_add_device_i2c(NULL, 0);
 
        /* MMC */
-       at91_add_device_mmc(0, &ecb_at91mmc_data);
+       at91_add_device_mci(0, &ecbat91_mci0_data);
 
        /* SPI */
        at91_add_device_spi(ecb_at91spi_devices, ARRAY_SIZE(ecb_at91spi_devices));
index 558546cf63f492bf46d5b290b389e019f428244a..40e957d1a612fc09d4efde12d19a1739af07898a 100644 (file)
@@ -55,12 +55,12 @@ static struct at91_udc_data __initdata eco920_udc_data = {
        .pullup_pin     = AT91_PIN_PB13,
 };
 
-static struct at91_mmc_data __initdata eco920_mmc_data = {
-       .slot_b         = 0,
-       .wire4          = 0,
-       .det_pin        = -EINVAL,
-       .wp_pin         = -EINVAL,
-       .vcc_pin        = -EINVAL,
+static struct mci_platform_data __initdata eco920_mci0_data = {
+       .slot[0] = {
+               .bus_width      = 1,
+               .detect_pin     = -EINVAL,
+               .wp_pin         = -EINVAL,
+       },
 };
 
 static struct physmap_flash_data eco920_flash_data = {
@@ -103,7 +103,7 @@ static void __init eco920_board_init(void)
        at91_add_device_usbh(&eco920_usbh_data);
        at91_add_device_udc(&eco920_udc_data);
 
-       at91_add_device_mmc(0, &eco920_mmc_data);
+       at91_add_device_mci(0, &eco920_mci0_data);
        platform_device_register(&eco920_flash);
 
        at91_ramc_write(0, AT91_SMC_CSR(7),     AT91_SMC_RWHOLD_(1)
index 47658f78105db41fad698b7d438444f60c8f6cbf..23ad652edad41ccedfe34bd52fb04de0ecd97329 100644 (file)
@@ -74,12 +74,12 @@ static struct spi_board_info flexibity_spi_devices[] = {
 };
 
 /* MCI (SD/MMC) */
-static struct at91_mmc_data __initdata flexibity_mmc_data = {
-       .slot_b         = 0,
-       .wire4          = 1,
-       .det_pin        = AT91_PIN_PC9,
-       .wp_pin         = AT91_PIN_PC4,
-       .vcc_pin        = -EINVAL,
+static struct mci_platform_data __initdata flexibity_mci0_data = {
+       .slot[0] = {
+               .bus_width      = 4,
+               .detect_pin     = AT91_PIN_PC9,
+               .wp_pin         = AT91_PIN_PC4,
+       },
 };
 
 /* LEDs */
@@ -151,7 +151,7 @@ static void __init flexibity_board_init(void)
        at91_add_device_spi(flexibity_spi_devices,
                ARRAY_SIZE(flexibity_spi_devices));
        /* MMC */
-       at91_add_device_mmc(0, &flexibity_mmc_data);
+       at91_add_device_mci(0, &flexibity_mci0_data);
        /* LEDs */
        at91_gpio_leds(flexibity_leds, ARRAY_SIZE(flexibity_leds));
 }
index 33411e6ecb1f1747f7431721003e4b722218bf57..0fc218160ae24522e97595d9d08aae8675e26b4d 100644 (file)
@@ -85,7 +85,7 @@ static struct at91_udc_data __initdata foxg20_udc_data = {
  * SPI devices.
  */
 static struct spi_board_info foxg20_spi_devices[] = {
-#if !defined(CONFIG_MMC_AT91)
+#if !IS_ENABLED(CONFIG_MMC_ATMELMCI)
        {
                .modalias       = "mtd_dataflash",
                .chip_select    = 1,
@@ -108,12 +108,12 @@ static struct macb_platform_data __initdata foxg20_macb_data = {
  * MCI (SD/MMC)
  * det_pin, wp_pin and vcc_pin are not connected
  */
-static struct at91_mmc_data __initdata foxg20_mmc_data = {
-       .slot_b         = 1,
-       .wire4          = 1,
-       .det_pin        = -EINVAL,
-       .wp_pin         = -EINVAL,
-       .vcc_pin        = -EINVAL,
+static struct mci_platform_data __initdata foxg20_mci0_data = {
+       .slot[1] = {
+               .bus_width      = 4,
+               .detect_pin     = -EINVAL,
+               .wp_pin         = -EINVAL,
+       },
 };
 
 
@@ -246,7 +246,7 @@ static void __init foxg20_board_init(void)
        /* Ethernet */
        at91_add_device_eth(&foxg20_macb_data);
        /* MMC */
-       at91_add_device_mmc(0, &foxg20_mmc_data);
+       at91_add_device_mci(0, &foxg20_mci0_data);
        /* I2C */
        at91_add_device_i2c(foxg20_i2c_devices, ARRAY_SIZE(foxg20_i2c_devices));
        /* LEDs */
index ba39db5482b955617689e7f65adb39e245915738..1fa6010ca50411358660a5833f333d5f46d87683 100644 (file)
@@ -68,12 +68,12 @@ static struct at91_udc_data __initdata kb9202_udc_data = {
        .pullup_pin     = AT91_PIN_PB22,
 };
 
-static struct at91_mmc_data __initdata kb9202_mmc_data = {
-       .det_pin        = AT91_PIN_PB2,
-       .slot_b         = 0,
-       .wire4          = 1,
-       .wp_pin         = -EINVAL,
-       .vcc_pin        = -EINVAL,
+static struct mci_platform_data __initdata kb9202_mci0_data = {
+       .slot[0] = {
+               .bus_width      = 4,
+               .detect_pin     = AT91_PIN_PB2,
+               .wp_pin         = -EINVAL,
+       },
 };
 
 static struct mtd_partition __initdata kb9202_nand_partition[] = {
@@ -120,7 +120,7 @@ static void __init kb9202_board_init(void)
        /* USB Device */
        at91_add_device_udc(&kb9202_udc_data);
        /* MMC */
-       at91_add_device_mmc(0, &kb9202_mmc_data);
+       at91_add_device_mci(0, &kb9202_mci0_data);
        /* I2C */
        at91_add_device_i2c(NULL, 0);
        /* SPI */
index d2f4cc1617669e9d92729c47dde9d6c1bc84a0cf..061168ee4f102ff28c15a328b809966638720edd 100644 (file)
@@ -137,11 +137,12 @@ static struct spi_board_info neocore926_spi_devices[] = {
 /*
  * MCI (SD/MMC)
  */
-static struct at91_mmc_data __initdata neocore926_mmc_data = {
-       .wire4          = 1,
-       .det_pin        = AT91_PIN_PE18,
-       .wp_pin         = AT91_PIN_PE19,
-       .vcc_pin        = -EINVAL,
+static struct mci_platform_data __initdata neocore926_mci0_data = {
+       .slot[0] = {
+               .bus_width      = 4,
+               .detect_pin     = AT91_PIN_PE18,
+               .wp_pin         = AT91_PIN_PE19,
+       },
 };
 
 
@@ -353,7 +354,7 @@ static void __init neocore926_board_init(void)
        neocore926_add_device_ts();
 
        /* MMC */
-       at91_add_device_mmc(1, &neocore926_mmc_data);
+       at91_add_device_mci(0, &neocore926_mci0_data);
 
        /* Ethernet */
        at91_add_device_eth(&neocore926_macb_data);
index b45c0a5d5ca7649c745d4718a329d0ee65fbdf20..96db6b259f86bc20e7172803249c12c9afe66de1 100644 (file)
@@ -61,12 +61,12 @@ static struct at91_usbh_data __initdata picotux200_usbh_data = {
        .overcurrent_pin= {-EINVAL, -EINVAL},
 };
 
-static struct at91_mmc_data __initdata picotux200_mmc_data = {
-       .det_pin        = AT91_PIN_PB27,
-       .slot_b         = 0,
-       .wire4          = 1,
-       .wp_pin         = AT91_PIN_PA17,
-       .vcc_pin        = -EINVAL,
+static struct mci_platform_data __initdata picotux200_mci0_data = {
+       .slot[0] = {
+               .bus_width      = 4,
+               .detect_pin     = AT91_PIN_PB27,
+               .wp_pin         = AT91_PIN_PA17,
+       },
 };
 
 #define PICOTUX200_FLASH_BASE  AT91_CHIPSELECT_0
@@ -111,7 +111,7 @@ static void __init picotux200_board_init(void)
        at91_add_device_i2c(NULL, 0);
        /* MMC */
        at91_set_gpio_output(AT91_PIN_PB22, 1); /* this MMC card slot can optionally use SPI signaling (CS3). */
-       at91_add_device_mmc(0, &picotux200_mmc_data);
+       at91_add_device_mci(0, &picotux200_mci0_data);
        /* NOR Flash */
        platform_device_register(&picotux200_flash);
 }
index 0c61bf0d272c3b02215da56a7cfbdf7c2ce6a0fd..847cc00e23df2b3e1829b99b0e25594a63a9c4a8 100644 (file)
@@ -155,12 +155,12 @@ static void __init ek_add_device_nand(void)
 /*
  * MCI (SD/MMC)
  */
-static struct at91_mmc_data __initdata ek_mmc_data = {
-       .slot_b         = 0,
-       .wire4          = 1,
-       .det_pin        = -EINVAL,
-       .wp_pin         = -EINVAL,
-       .vcc_pin        = -EINVAL,
+static struct mci_platform_data __initdata ek_mci0_data = {
+       .slot[0] = {
+               .bus_width      = 4,
+               .detect_pin     = -EINVAL,
+               .wp_pin         = -EINVAL,
+       },
 };
 
 /*
@@ -244,7 +244,7 @@ static void __init ek_board_init(void)
        /* Ethernet */
        at91_add_device_eth(&ek_macb_data);
        /* MMC */
-       at91_add_device_mmc(0, &ek_mmc_data);
+       at91_add_device_mci(0, &ek_mci0_data);
        /* Push Buttons */
        ek_add_device_buttons();
        /* LEDs */
index afd7a4713766cec538c1736daf0895f691d6ebf3..6564c13f5e226b2aca207b52699ec319ad4a0738 100644 (file)
@@ -76,12 +76,12 @@ static struct at91_cf_data __initdata dk_cf_data = {
 };
 
 #ifndef CONFIG_MTD_AT91_DATAFLASH_CARD
-static struct at91_mmc_data __initdata dk_mmc_data = {
-       .slot_b         = 0,
-       .wire4          = 1,
-       .det_pin        = -EINVAL,
-       .wp_pin         = -EINVAL,
-       .vcc_pin        = -EINVAL,
+static struct mci_platform_data __initdata dk_mci0_data = {
+       .slot[0] = {
+               .bus_width      = 4,
+               .detect_pin     = -EINVAL,
+               .wp_pin         = -EINVAL,
+       },
 };
 #endif
 
@@ -207,7 +207,7 @@ static void __init dk_board_init(void)
 #else
        /* MMC */
        at91_set_gpio_output(AT91_PIN_PB7, 1);  /* this MMC card slot can optionally use SPI signaling (CS3). */
-       at91_add_device_mmc(0, &dk_mmc_data);
+       at91_add_device_mci(0, &dk_mci0_data);
 #endif
        /* NAND */
        at91_add_device_nand(&dk_nand_data);
index 2b15b8adec4ccb9c671fab7e2423a59f2860ad89..58144a0a5388a4d898287455f8d10d6262f04260 100644 (file)
@@ -69,12 +69,12 @@ static struct at91_udc_data __initdata ek_udc_data = {
 };
 
 #ifndef CONFIG_MTD_AT91_DATAFLASH_CARD
-static struct at91_mmc_data __initdata ek_mmc_data = {
-       .det_pin        = AT91_PIN_PB27,
-       .slot_b         = 0,
-       .wire4          = 1,
-       .wp_pin         = AT91_PIN_PA17,
-       .vcc_pin        = -EINVAL,
+static struct mci_platform_data __initdata ek_mci0_data = {
+       .slot[0] = {
+               .bus_width      = 4,
+               .detect_pin     = AT91_PIN_PB27,
+               .wp_pin         = AT91_PIN_PA17,
+       }
 };
 #endif
 
@@ -176,7 +176,7 @@ static void __init ek_board_init(void)
 #else
        /* MMC */
        at91_set_gpio_output(AT91_PIN_PB22, 1); /* this MMC card slot can optionally use SPI signaling (CS3). */
-       at91_add_device_mmc(0, &ek_mmc_data);
+       at91_add_device_mci(0, &ek_mci0_data);
 #endif
        /* NOR Flash */
        platform_device_register(&ek_flash);
index 24ab9be7510fbe5f6cdd3296be794fd7affa8cdc..f63158f1f0221ad219ecadbbabf59a9eba576596 100644 (file)
@@ -57,11 +57,12 @@ static struct at91_usbh_data rsi_ews_usbh_data __initdata = {
 /*
  * SD/MC
  */
-static struct at91_mmc_data rsi_ews_mmc_data __initdata = {
-       .slot_b         = 0,
-       .wire4          = 1,
-       .det_pin        = AT91_PIN_PB27,
-       .wp_pin         = AT91_PIN_PB29,
+static struct mci_platform_data __initdata rsi_ews_mci0_data = {
+       .slot[0] = {
+               .bus_width      = 4,
+               .detect_pin     = AT91_PIN_PB27,
+               .wp_pin         = AT91_PIN_PB29,
+       },
 };
 
 /*
@@ -214,7 +215,7 @@ static void __init rsi_ews_board_init(void)
        at91_add_device_spi(rsi_ews_spi_devices,
                        ARRAY_SIZE(rsi_ews_spi_devices));
        /* MMC */
-       at91_add_device_mmc(0, &rsi_ews_mmc_data);
+       at91_add_device_mci(0, &rsi_ews_mci0_data);
        /* NOR Flash */
        platform_device_register(&rsiews_nor_flash);
        /* LEDs */
index cdd21f2595d2220de8fc828f636d240e0d0b1476..0af92e6cce64575eb92534f012e2af7e920a0ad5 100644 (file)
@@ -72,7 +72,7 @@ static struct at91_udc_data __initdata ek_udc_data = {
  * SPI devices.
  */
 static struct spi_board_info ek_spi_devices[] = {
-#if !defined(CONFIG_MMC_AT91)
+#if !IS_ENABLED(CONFIG_MMC_ATMELMCI)
        {       /* DataFlash chip */
                .modalias       = "mtd_dataflash",
                .chip_select    = 1,
@@ -157,12 +157,12 @@ static void __init ek_add_device_nand(void)
 /*
  * MCI (SD/MMC)
  */
-static struct at91_mmc_data __initdata ek_mmc_data = {
-       .slot_b         = 1,
-       .wire4          = 1,
-       .det_pin        = AT91_PIN_PC8,
-       .wp_pin         = AT91_PIN_PC4,
-       .vcc_pin        = -EINVAL,
+static struct mci_platform_data __initdata ek_mci0_data = {
+       .slot[1] = {
+               .bus_width      = 4,
+               .detect_pin     = AT91_PIN_PC8,
+               .wp_pin         = AT91_PIN_PC4,
+       },
 };
 
 static void __init ek_board_init(void)
@@ -193,7 +193,7 @@ static void __init ek_board_init(void)
        /* Ethernet */
        at91_add_device_eth(&ek_macb_data);
        /* MMC */
-       at91_add_device_mmc(0, &ek_mmc_data);
+       at91_add_device_mci(0, &ek_mci0_data);
        /* I2C */
        at91_add_device_i2c(NULL, 0);
 }
index 7b3c3913551a53ccc7a08eef94b5a18b7bba428b..55f0104c0a4b778d3aaa0063df886ef325b44e34 100644 (file)
@@ -107,7 +107,7 @@ static void __init at73c213_set_clk(struct at73c213_board_info *info) {}
  * SPI devices.
  */
 static struct spi_board_info ek_spi_devices[] = {
-#if !defined(CONFIG_MMC_AT91)
+#if !IS_ENABLED(CONFIG_MMC_ATMELMCI)
        {       /* DataFlash chip */
                .modalias       = "mtd_dataflash",
                .chip_select    = 1,
@@ -210,12 +210,12 @@ static void __init ek_add_device_nand(void)
 /*
  * MCI (SD/MMC)
  */
-static struct at91_mmc_data __initdata ek_mmc_data = {
-       .slot_b         = 1,
-       .wire4          = 1,
-       .det_pin        = -EINVAL,
-       .wp_pin         = -EINVAL,
-       .vcc_pin        = -EINVAL,
+static struct mci_platform_data __initdata ek_mci0_data = {
+       .slot[1] = {
+               .bus_width      = 4,
+               .detect_pin     = -EINVAL,
+               .wp_pin         = -EINVAL,
+       },
 };
 
 
@@ -328,7 +328,7 @@ static void __init ek_board_init(void)
        /* Ethernet */
        at91_add_device_eth(&ek_macb_data);
        /* MMC */
-       at91_add_device_mmc(0, &ek_mmc_data);
+       at91_add_device_mci(0, &ek_mci0_data);
        /* I2C */
        at91_add_device_i2c(ek_i2c_devices, ARRAY_SIZE(ek_i2c_devices));
        /* SSC (to AT73C213) */
index 2736453821b0d55e9782d065107c176102ca4c35..f3b2fe24fc5647bd58a2a6ff46035d114f52c93c 100644 (file)
@@ -339,11 +339,12 @@ static struct spi_board_info ek_spi_devices[] = {
  * MCI (SD/MMC)
  * det_pin, wp_pin and vcc_pin are not connected
  */
-static struct at91_mmc_data __initdata ek_mmc_data = {
-       .wire4          = 1,
-       .det_pin        = -EINVAL,
-       .wp_pin         = -EINVAL,
-       .vcc_pin        = -EINVAL,
+static struct mci_platform_data __initdata mci0_data = {
+       .slot[0] = {
+               .bus_width      = 4,
+               .detect_pin     = -EINVAL,
+               .wp_pin         = -EINVAL,
+       },
 };
 
 #endif /* CONFIG_SPI_ATMEL_* */
@@ -597,7 +598,7 @@ static void __init ek_board_init(void)
        at91_add_device_ssc(AT91SAM9261_ID_SSC1, ATMEL_SSC_TX);
 #else
        /* MMC */
-       at91_add_device_mmc(0, &ek_mmc_data);
+       at91_add_device_mci(0, &mci0_data);
 #endif
        /* LCD Controller */
        at91_add_device_lcdc(&ek_lcdc_data);
index 983cb98d2465c7253b2c9c2900de5379e2636979..4c8d92a2ea17e3cd205a055cf317f36ecb4c588a 100644 (file)
@@ -140,11 +140,12 @@ static struct spi_board_info ek_spi_devices[] = {
 /*
  * MCI (SD/MMC)
  */
-static struct at91_mmc_data __initdata ek_mmc_data = {
-       .wire4          = 1,
-       .det_pin        = AT91_PIN_PE18,
-       .wp_pin         = AT91_PIN_PE19,
-       .vcc_pin        = -EINVAL,
+static struct mci_platform_data __initdata mci1_data = {
+       .slot[0] = {
+               .bus_width      = 4,
+               .detect_pin     = AT91_PIN_PE18,
+               .wp_pin         = AT91_PIN_PE19,
+       },
 };
 
 
@@ -419,7 +420,7 @@ static void __init ek_board_init(void)
        /* Touchscreen */
        ek_add_device_ts();
        /* MMC */
-       at91_add_device_mmc(1, &ek_mmc_data);
+       at91_add_device_mci(1, &mci1_data);
        /* Ethernet */
        at91_add_device_eth(&ek_macb_data);
        /* NAND */
index 6860d3451100321a8bfd8930c6d5bc96e5fc3b9e..40d595aaed284d6db86a70b61aa3ba85f42672f4 100644 (file)
@@ -91,7 +91,7 @@ static struct at91_udc_data __initdata ek_udc_data = {
  * SPI devices.
  */
 static struct spi_board_info ek_spi_devices[] = {
-#if !(defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_AT91))
+#if !IS_ENABLED(CONFIG_MMC_ATMELMCI)
        {       /* DataFlash chip */
                .modalias       = "mtd_dataflash",
                .chip_select    = 1,
@@ -198,7 +198,6 @@ static void __init ek_add_device_nand(void)
  * MCI (SD/MMC)
  * wp_pin and vcc_pin are not connected
  */
-#if defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_ATMELMCI_MODULE)
 static struct mci_platform_data __initdata ek_mmc_data = {
        .slot[1] = {
                .bus_width      = 4,
@@ -207,28 +206,15 @@ static struct mci_platform_data __initdata ek_mmc_data = {
        },
 
 };
-#else
-static struct at91_mmc_data __initdata ek_mmc_data = {
-       .slot_b         = 1,    /* Only one slot so use slot B */
-       .wire4          = 1,
-       .det_pin        = AT91_PIN_PC9,
-       .wp_pin         = -EINVAL,
-       .vcc_pin        = -EINVAL,
-};
-#endif
 
 static void __init ek_add_device_mmc(void)
 {
-#if defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_ATMELMCI_MODULE)
        if (ek_have_2mmc()) {
                ek_mmc_data.slot[0].bus_width = 4;
                ek_mmc_data.slot[0].detect_pin = AT91_PIN_PC2;
                ek_mmc_data.slot[0].wp_pin = -1;
        }
        at91_add_device_mci(0, &ek_mmc_data);
-#else
-       at91_add_device_mmc(0, &ek_mmc_data);
-#endif
 }
 
 /*
index be3239f13daa64341598d1b5f33041ff44058eab..61d2ba8a4e5733890b5c9fada0240de496e1ad33 100644 (file)
@@ -55,11 +55,12 @@ static struct usba_platform_data __initdata ek_usba_udc_data = {
 /*
  * MCI (SD/MMC)
  */
-static struct at91_mmc_data __initdata ek_mmc_data = {
-       .wire4          = 1,
-       .det_pin        = AT91_PIN_PA15,
-       .wp_pin         = -EINVAL,
-       .vcc_pin        = -EINVAL,
+static struct mci_platform_data __initdata mci0_data = {
+       .slot[0] = {
+               .bus_width      = 4,
+               .detect_pin     = AT91_PIN_PA15,
+               .wp_pin         = -EINVAL,
+       },
 };
 
 
@@ -302,7 +303,7 @@ static void __init ek_board_init(void)
        /* SPI */
        at91_add_device_spi(ek_spi_devices, ARRAY_SIZE(ek_spi_devices));
        /* MMC */
-       at91_add_device_mmc(0, &ek_mmc_data);
+       at91_add_device_mci(0, &mci0_data);
        /* LCD Controller */
        at91_add_device_lcdc(&ek_lcdc_data);
        /* AC97 */
index ee86f9d7ee72ed87bf408e273858be3dbe4586e1..7d890a065bb90cdac9c0331c4bc0bbd01653c6f3 100644 (file)
@@ -82,7 +82,6 @@ static void __init add_device_nand(void)
  * MCI (SD/MMC)
  * det_pin, wp_pin and vcc_pin are not connected
  */
-#if defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_ATMELMCI_MODULE)
 static struct mci_platform_data __initdata mmc_data = {
        .slot[0] = {
                .bus_width      = 4,
@@ -90,15 +89,6 @@ static struct mci_platform_data __initdata mmc_data = {
                .wp_pin         = -1,
        },
 };
-#else
-static struct at91_mmc_data __initdata mmc_data = {
-       .slot_b         = 0,
-       .wire4          = 1,
-       .det_pin        = -EINVAL,
-       .wp_pin         = -EINVAL,
-       .vcc_pin        = -EINVAL,
-};
-#endif
 
 
 /*
@@ -222,11 +212,7 @@ void __init stamp9g20_board_init(void)
        /* NAND */
        add_device_nand();
        /* MMC */
-#if defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_ATMELMCI_MODULE)
        at91_add_device_mci(0, &mmc_data);
-#else
-       at91_add_device_mmc(0, &mmc_data);
-#endif
        /* W1 */
        add_w1();
 }
index 95393fcaf199c9664bc6cafa8fafe17e826e5d92..c87ea80fd121cab7b50bef53d1711a8008fa003d 100644 (file)
@@ -108,14 +108,12 @@ static struct mmc_spi_platform_data at91_mmc_spi_pdata = {
  * SPI devices.
  */
 static struct spi_board_info usb_a9263_spi_devices[] = {
-#if !defined(CONFIG_MMC_AT91)
        {       /* DataFlash chip */
                .modalias       = "mtd_dataflash",
                .chip_select    = 0,
                .max_speed_hz   = 15 * 1000 * 1000,
                .bus_num        = 0,
        }
-#endif
 };
 
 static struct spi_board_info usb_a9g20_spi_devices[] = {
index d56665ea4b55d3a8259228d8801fe20a547b9bab..6cb972e2f1e77e5ef64137dad21b72f6a4553398 100644 (file)
@@ -118,11 +118,12 @@ static struct at91_udc_data __initdata yl9200_udc_data = {
 /*
  * MMC
  */
-static struct at91_mmc_data __initdata yl9200_mmc_data = {
-       .det_pin        = AT91_PIN_PB9,
-       .wire4          = 1,
-       .wp_pin         = -EINVAL,
-       .vcc_pin        = -EINVAL,
+static struct mci_platform_data __initdata yl9200_mci0_data = {
+       .slot[0] = {
+               .bus_width      = 4,
+               .detect_pin     = AT91_PIN_PB9,
+               .wp_pin         = -EINVAL,
+       },
 };
 
 /*
@@ -567,7 +568,7 @@ static void __init yl9200_board_init(void)
        /* I2C */
        at91_add_device_i2c(yl9200_i2c_devices, ARRAY_SIZE(yl9200_i2c_devices));
        /* MMC */
-       at91_add_device_mmc(0, &yl9200_mmc_data);
+       at91_add_device_mci(0, &yl9200_mci0_data);
        /* NAND */
        at91_add_device_nand(&yl9200_nand_data);
        /* NOR Flash */