Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9a788c6b78802b4a378be3f0d4c2da30da811620
Commit:     9a788c6b78802b4a378be3f0d4c2da30da811620
Parent:     64eb036af42d3816364c4db49d93be3a4614389c
Author:     Bridge Wu <[EMAIL PROTECTED]>
AuthorDate: Fri Dec 14 10:40:25 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 15:07:52 2008 +0000

    [ARM] 4711/1: pxa: mmc: move DMA specific code to platform layer
    
    This patch is to move pxamci DMA specific code to corresponding
    platform layer because using DRCMRRXMMC/DRCMRTXMMC in pxamci.c makes
    the driver code dedicated to platform which is not extensible.
    
    It is applicable to all pxa platforms.
    
    Signed-off-by: Bridge Wu <[EMAIL PROTECTED]>
    Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/mach-pxa/generic.c |   10 ++++++++++
 drivers/mmc/host/pxamci.c   |   30 +++++++++++++++++++++++-------
 2 files changed, 33 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-pxa/generic.c b/arch/arm/mach-pxa/generic.c
index 8bb70e7..a8d8870 100644
--- a/arch/arm/mach-pxa/generic.c
+++ b/arch/arm/mach-pxa/generic.c
@@ -259,6 +259,16 @@ static struct resource pxamci_resources[] = {
                .end    = IRQ_MMC,
                .flags  = IORESOURCE_IRQ,
        },
+       [2] = {
+               .start  = 21,
+               .end    = 21,
+               .flags  = IORESOURCE_DMA,
+       },
+       [3] = {
+               .start  = 22,
+               .end    = 22,
+               .flags  = IORESOURCE_DMA,
+       },
 };
 
 static u64 pxamci_dmamask = 0xffffffffUL;
diff --git a/drivers/mmc/host/pxamci.c b/drivers/mmc/host/pxamci.c
index 80df4b0..1ea8482 100644
--- a/drivers/mmc/host/pxamci.c
+++ b/drivers/mmc/host/pxamci.c
@@ -65,6 +65,8 @@ struct pxamci_host {
        unsigned int            dma_len;
 
        unsigned int            dma_dir;
+       unsigned int            dma_drcmrrx;
+       unsigned int            dma_drcmrtx;
 };
 
 static void pxamci_stop_clock(struct pxamci_host *host)
@@ -131,13 +133,13 @@ static void pxamci_setup_data(struct pxamci_host *host, 
struct mmc_data *data)
        if (data->flags & MMC_DATA_READ) {
                host->dma_dir = DMA_FROM_DEVICE;
                dcmd = DCMD_INCTRGADDR | DCMD_FLOWTRG;
-               DRCMRTXMMC = 0;
-               DRCMRRXMMC = host->dma | DRCMR_MAPVLD;
+               DRCMR(host->dma_drcmrtx) = 0;
+               DRCMR(host->dma_drcmrrx) = host->dma | DRCMR_MAPVLD;
        } else {
                host->dma_dir = DMA_TO_DEVICE;
                dcmd = DCMD_INCSRCADDR | DCMD_FLOWSRC;
-               DRCMRRXMMC = 0;
-               DRCMRTXMMC = host->dma | DRCMR_MAPVLD;
+               DRCMR(host->dma_drcmrrx) = 0;
+               DRCMR(host->dma_drcmrtx) = host->dma | DRCMR_MAPVLD;
        }
 
        dcmd |= DCMD_BURST32 | DCMD_WIDTH1;
@@ -468,7 +470,7 @@ static int pxamci_probe(struct platform_device *pdev)
 {
        struct mmc_host *mmc;
        struct pxamci_host *host = NULL;
-       struct resource *r;
+       struct resource *r, *dmarx, *dmatx;
        int ret, irq;
 
        r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -583,6 +585,20 @@ static int pxamci_probe(struct platform_device *pdev)
 
        platform_set_drvdata(pdev, mmc);
 
+       dmarx = platform_get_resource(pdev, IORESOURCE_DMA, 0);
+       if (!dmarx) {
+               ret = -ENXIO;
+               goto out;
+       }
+       host->dma_drcmrrx = dmarx->start;
+
+       dmatx = platform_get_resource(pdev, IORESOURCE_DMA, 1);
+       if (!dmatx) {
+               ret = -ENXIO;
+               goto out;
+       }
+       host->dma_drcmrtx = dmatx->start;
+
        if (host->pdata && host->pdata->init)
                host->pdata->init(&pdev->dev, pxamci_detect_irq, mmc);
 
@@ -626,8 +642,8 @@ static int pxamci_remove(struct platform_device *pdev)
                       END_CMD_RES|PRG_DONE|DATA_TRAN_DONE,
                       host->base + MMC_I_MASK);
 
-               DRCMRRXMMC = 0;
-               DRCMRTXMMC = 0;
+               DRCMR(host->dma_drcmrrx) = 0;
+               DRCMR(host->dma_drcmrtx) = 0;
 
                free_irq(host->irq, host);
                pxa_free_dma(host->dma);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to