DA850: Add MMCSD1 resources, platform device and convenience registration function
authorJuha Kuikka <juha.kuikka@elektrobit.com>
Thu, 26 Aug 2010 19:40:47 +0000 (12:40 -0700)
committerKevin Hilman <khilman@deeprootsystems.com>
Fri, 24 Sep 2010 14:40:26 +0000 (07:40 -0700)
Add resources, platform device and convenience registration function for DA850's second MMC/SD controller (MMCSD1).

Signed-off-by: Juha Kuikka <juha.kuikka@elektrobit.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
arch/arm/mach-davinci/devices-da8xx.c
arch/arm/mach-davinci/include/mach/da8xx.h

index 52bc7b1c6ca3365309bd407254163f3811469031..caeb7f4a3a6df717b65cb982c72a41a7f3d09994 100644 (file)
@@ -24,6 +24,7 @@
 #include "clock.h"
 
 #define DA8XX_TPCC_BASE                        0x01c00000
+#define DA850_MMCSD1_BASE              0x01e1b000
 #define DA850_TPCC1_BASE               0x01e30000
 #define DA8XX_TPTC0_BASE               0x01c08000
 #define DA8XX_TPTC1_BASE               0x01c08400
@@ -566,6 +567,44 @@ int __init da8xx_register_mmcsd0(struct davinci_mmc_config *config)
        return platform_device_register(&da8xx_mmcsd0_device);
 }
 
+#ifdef CONFIG_ARCH_DAVINCI_DA850
+static struct resource da850_mmcsd1_resources[] = {
+       {               /* registers */
+               .start  = DA850_MMCSD1_BASE,
+               .end    = DA850_MMCSD1_BASE + SZ_4K - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       {               /* interrupt */
+               .start  = IRQ_DA850_MMCSDINT0_1,
+               .end    = IRQ_DA850_MMCSDINT0_1,
+               .flags  = IORESOURCE_IRQ,
+       },
+       {               /* DMA RX */
+               .start  = EDMA_CTLR_CHAN(1, 28),
+               .end    = EDMA_CTLR_CHAN(1, 28),
+               .flags  = IORESOURCE_DMA,
+       },
+       {               /* DMA TX */
+               .start  = EDMA_CTLR_CHAN(1, 29),
+               .end    = EDMA_CTLR_CHAN(1, 29),
+               .flags  = IORESOURCE_DMA,
+       },
+};
+
+static struct platform_device da850_mmcsd1_device = {
+       .name           = "davinci_mmc",
+       .id             = 1,
+       .num_resources  = ARRAY_SIZE(da850_mmcsd1_resources),
+       .resource       = da850_mmcsd1_resources,
+};
+
+int __init da850_register_mmcsd1(struct davinci_mmc_config *config)
+{
+       da850_mmcsd1_device.dev.platform_data = config;
+       return platform_device_register(&da850_mmcsd1_device);
+}
+#endif
+
 static struct resource da8xx_rtc_resources[] = {
        {
                .start          = DA8XX_RTC_BASE,
index 504f2f62066cb0fd87b37a1564fea8282d87d462..4247b3f53b338f596b37fc1664becc3c82df727e 100644 (file)
@@ -76,6 +76,7 @@ int da8xx_register_usb11(struct da8xx_ohci_root_hub *pdata);
 int da8xx_register_emac(void);
 int da8xx_register_lcdc(struct da8xx_lcdc_platform_data *pdata);
 int da8xx_register_mmcsd0(struct davinci_mmc_config *config);
+int da850_register_mmcsd1(struct davinci_mmc_config *config);
 void __init da8xx_register_mcasp(int id, struct snd_platform_data *pdata);
 int da8xx_register_rtc(void);
 int da850_register_cpufreq(char *async_clk);