Merge branch 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6
[safe/jmp/linux-2.6] / drivers / mmc / host / au1xmmc.c
index 99b2091..c8da5d3 100644 (file)
@@ -41,6 +41,7 @@
 #include <linux/scatterlist.h>
 #include <linux/leds.h>
 #include <linux/mmc/host.h>
+#include <linux/slab.h>
 
 #include <asm/io.h>
 #include <asm/mach-au1x00/au1000.h>
 
 /* Hardware definitions */
 #define AU1XMMC_DESCRIPTOR_COUNT 1
-#define AU1XMMC_DESCRIPTOR_SIZE  2048
+
+/* max DMA seg size: 64KB on Au1100, 4MB on Au1200 */
+#ifdef CONFIG_SOC_AU1100
+#define AU1XMMC_DESCRIPTOR_SIZE 0x0000ffff
+#else  /* Au1200 */
+#define AU1XMMC_DESCRIPTOR_SIZE 0x003fffff
+#endif
 
 #define AU1XMMC_OCR (MMC_VDD_27_28 | MMC_VDD_28_29 | MMC_VDD_29_30 | \
                     MMC_VDD_30_31 | MMC_VDD_31_32 | MMC_VDD_32_33 | \
@@ -644,11 +651,11 @@ static int au1xmmc_prepare_data(struct au1xmmc_host *host,
                                flags = DDMA_FLAGS_IE;
 
                        if (host->flags & HOST_F_XMIT) {
-                               ret = au1xxx_dbdma_put_source_flags(channel,
-                                       (void *)sg_virt(sg), len, flags);
+                               ret = au1xxx_dbdma_put_source(channel,
+                                       sg_phys(sg), len, flags);
                        } else {
-                               ret = au1xxx_dbdma_put_dest_flags(channel,
-                                       (void *)sg_virt(sg), len, flags);
+                               ret = au1xxx_dbdma_put_dest(channel,
+                                       sg_phys(sg), len, flags);
                        }
 
                        if (!ret)
@@ -1011,6 +1018,10 @@ static int __devinit au1xmmc_probe(struct platform_device *pdev)
        } else
                mmc->caps |= MMC_CAP_NEEDS_POLL;
 
+       /* platform may not be able to use all advertised caps */
+       if (host->platdata)
+               mmc->caps &= ~(host->platdata->mask_host_caps);
+
        tasklet_init(&host->data_task, au1xmmc_tasklet_data,
                        (unsigned long)host);
 
@@ -1131,7 +1142,7 @@ static int au1xmmc_suspend(struct platform_device *pdev, pm_message_t state)
        struct au1xmmc_host *host = platform_get_drvdata(pdev);
        int ret;
 
-       ret = mmc_suspend_host(host->mmc, state);
+       ret = mmc_suspend_host(host->mmc);
        if (ret)
                return ret;