mod sdmmc
author柯飞雄 <kfx@rock-chips.com>
Sat, 29 May 2010 02:35:17 +0000 (02:35 +0000)
committer黄涛 <huangtao@rock-chips.com>
Mon, 21 Jun 2010 05:35:19 +0000 (13:35 +0800)
drivers/mmc/host/Kconfig
drivers/mmc/host/rk2818-sdmmc.c

index c1dca8a8e443419a0bd5a8e100d10864048ea3e4..c58ddc0eecc1a5e7ebc25f02cedaff43a5311710 100644 (file)
@@ -13,14 +13,14 @@ config SDMMC_RK2818
 if SDMMC_RK2818
     comment "Now, there are two SDMMC controllers selected, SDMMC0 and SDMMC1."
        config SDMMC0_RK2818
-               tristate "RK2818 SDMMC0 controller support"
+               tristate "RK2818 SDMMC0 controller support(sdmmc)"
                default y
                depends on ARCH_RK2818
                help
                        This supports the use of the SDMMC0 controller on rk2818 processors.
        
        config SDMMC1_RK2818
-               tristate "RK2818 SDMMC1 controller support"
+               tristate "RK2818 SDMMC1 controller support(sdio)"
                default y
                depends on ARCH_RK2818
                help
index 21dd0645321744a9e558e3c3f170ab993aa3c591..f011e3f536e2e32b5aded7e2e31fbb2d7147e90b 100644 (file)
@@ -341,6 +341,8 @@ static void rk2818_sdmmc_stop_dma(struct rk2818_sdmmc_host *host)
                writel(readl(host->regs + SDMMC_CTRL) & ~SDMMC_CTRL_DMA_ENABLE,
                                host->regs +SDMMC_CTRL);
                disable_dma(host->dma_chn);
+               free_dma(host->dma_chn);
+               host->dma_chn = -1;
                rk2818_sdmmc_dma_cleanup(host);
        } else {
                /* Data transfer was stopped by the interrupt handler */
@@ -360,6 +362,7 @@ static void rk2818_sdmmc_dma_complete(int chn, void *arg)
        rk2818_sdmmc_dma_cleanup(host);
        disable_dma(host->dma_chn);
        free_dma(host->dma_chn);
+       host->dma_chn = -1;
        if (data) {
                rk2818_sdmmc_set_pending(host, EVENT_XFER_COMPLETE);
                tasklet_schedule(&host->tasklet);
@@ -1186,6 +1189,7 @@ static int rk2818_sdmmc_probe(struct platform_device *pdev)
        host->mmc = mmc;
        host->pdev = pdev;
        host->dev = &pdev->dev;
+       host->dma_chn = -1;
 
        host->use_dma = pdata->use_dma;
        host->no_detect = pdata->no_detect;
@@ -1276,7 +1280,7 @@ static int rk2818_sdmmc_probe(struct platform_device *pdev)
        
        mmc->max_phys_segs = 64;
        mmc->max_hw_segs = 64;
-       mmc->max_blk_size = /*4095*/1023;
+       mmc->max_blk_size = 4095;
        mmc->max_blk_count = /*512*/4;
        mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count;
        mmc->max_seg_size = mmc->max_req_size;