summaryrefslogtreecommitdiff
path: root/arch/arm/mach-davinci/board-dm355-leopard.c
diff options
context:
space:
mode:
authorKevin Hilman <khilman@deeprootsystems.com>2009-05-11 15:55:03 -0700
committerKevin Hilman <khilman@deeprootsystems.com>2009-05-26 07:18:16 -0700
commit2dbf56aeb7986b54651c93ed171877e8179289bc (patch)
treeecdc2e340ed799a884812abb200aac23279cb79b /arch/arm/mach-davinci/board-dm355-leopard.c
parent35652fe1858e664707cfa32e80547b210cc41f78 (diff)
davinci: MMC platform support
Add SoC and platform-specific data and init for MMC driver. Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-davinci/board-dm355-leopard.c')
-rw-r--r--arch/arm/mach-davinci/board-dm355-leopard.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/arch/arm/mach-davinci/board-dm355-leopard.c b/arch/arm/mach-davinci/board-dm355-leopard.c
index 22f16f38a0ba..d4562f5ff93b 100644
--- a/arch/arm/mach-davinci/board-dm355-leopard.c
+++ b/arch/arm/mach-davinci/board-dm355-leopard.c
@@ -35,6 +35,7 @@
#include <mach/i2c.h>
#include <mach/serial.h>
#include <mach/nand.h>
+#include <mach/mmc.h>
#define DAVINCI_ASYNC_EMIF_CONTROL_BASE 0x01e10000
#define DAVINCI_ASYNC_EMIF_DATA_CE0_BASE 0x02000000
@@ -190,6 +191,30 @@ static void __init dm355_leopard_map_io(void)
dm355_init();
}
+static int dm355leopard_mmc_get_cd(int module)
+{
+ if (!gpio_is_valid(leopard_mmc_gpio))
+ return -ENXIO;
+ /* low == card present */
+ return !gpio_get_value_cansleep(leopard_mmc_gpio + 2 * module + 1);
+}
+
+static int dm355leopard_mmc_get_ro(int module)
+{
+ if (!gpio_is_valid(leopard_mmc_gpio))
+ return -ENXIO;
+ /* high == card's write protect switch active */
+ return gpio_get_value_cansleep(leopard_mmc_gpio + 2 * module + 0);
+}
+
+static struct davinci_mmc_config dm355leopard_mmc_config = {
+ .get_cd = dm355leopard_mmc_get_cd,
+ .get_ro = dm355leopard_mmc_get_ro,
+ .wires = 4,
+ .max_freq = 50000000,
+ .caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED,
+};
+
/* Don't connect anything to J10 unless you're only using USB host
* mode *and* have to do so with some kind of gender-bender. If
* you have proper Mini-B or Mini-A cables (or Mini-A adapters)
@@ -248,6 +273,9 @@ static __init void dm355_leopard_init(void)
/* irlml6401 switches over 1A in under 8 msec */
setup_usb(500, 8);
+ davinci_setup_mmc(0, &dm355leopard_mmc_config);
+ davinci_setup_mmc(1, &dm355leopard_mmc_config);
+
dm355_init_spi0(BIT(0), dm355_leopard_spi_info,
ARRAY_SIZE(dm355_leopard_spi_info));
}