Pass the EDMA CC instance being used throgh MMC resource structure.
Also pass the EDMA channel controller instance number as argument
to the edma_alloc_slot api.

In the process, change the data types which hold the channel and slot
number, so that they are able to hold 32 bits.

This patch has been tested on DM644x.

Signed-off-by: Sudhakar Rajashekhara <[email protected]>
---
 arch/arm/mach-davinci/devices.c |    8 ++++----
 drivers/mmc/host/davinci_mmc.c  |   10 +++++-----
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/arch/arm/mach-davinci/devices.c b/arch/arm/mach-davinci/devices.c
index 3cb9385..8b004b1 100644
--- a/arch/arm/mach-davinci/devices.c
+++ b/arch/arm/mach-davinci/devices.c
@@ -89,10 +89,10 @@ static struct resource mmcsd0_resources[] = {
        },
        /* DMA channels: RX, then TX */
        {
-               .start = DAVINCI_DMA_MMCRXEVT,
+               .start = EDMA_CTLR_CHAN(0, DAVINCI_DMA_MMCRXEVT),
                .flags = IORESOURCE_DMA,
        }, {
-               .start = DAVINCI_DMA_MMCTXEVT,
+               .start = EDMA_CTLR_CHAN(0, DAVINCI_DMA_MMCTXEVT),
                .flags = IORESOURCE_DMA,
        },
 };
@@ -126,10 +126,10 @@ static struct resource mmcsd1_resources[] = {
        },
        /* DMA channels: RX, then TX */
        {
-               .start = 30,    /* rx */
+               .start = EDMA_CTLR_CHAN(0, 30), /* rx */
                .flags = IORESOURCE_DMA,
        }, {
-               .start = 31,    /* tx */
+               .start = EDMA_CTLR_CHAN(0, 31), /* tx */
                .flags = IORESOURCE_DMA,
        },
 };
diff --git a/drivers/mmc/host/davinci_mmc.c b/drivers/mmc/host/davinci_mmc.c
index 9b23802..dbe97f9 100644
--- a/drivers/mmc/host/davinci_mmc.c
+++ b/drivers/mmc/host/davinci_mmc.c
@@ -178,7 +178,7 @@ struct mmc_davinci_host {
        u32 buffer_bytes_left;
        u32 bytes_left;
 
-       u8 rxdma, txdma;
+       u32 rxdma, txdma;
        bool use_dma;
        bool do_dma;
 
@@ -190,7 +190,7 @@ struct mmc_davinci_host {
        struct edmacc_param     tx_template;
        struct edmacc_param     rx_template;
        unsigned                n_link;
-       u8                      links[NR_SG - 1];
+       u32                     links[NR_SG - 1];
 
        /* For PIO we walk scatterlists one segment at a time. */
        unsigned int            sg_len;
@@ -466,7 +466,7 @@ static void __init mmc_davinci_dma_setup(struct 
mmc_davinci_host *host,
        edma_read_slot(sync_dev, template);
 
        /* don't bother with irqs or chaining */
-       template->opt |= sync_dev << 12;
+       template->opt |= EDMA_CHAN(sync_dev) << 12;
 }
 
 static void mmc_davinci_send_dma_request(struct mmc_davinci_host *host,
@@ -500,7 +500,7 @@ static void mmc_davinci_send_dma_request(struct 
mmc_davinci_host *host,
                unsigned        count = sg_dma_len(sg);
 
                template->link_bcntrld = sg_len
-                               ? (host->links[link] << 5)
+                               ? (EDMA_CHAN(host->links[link]) << 5)
                                : 0xffff;
 
                if (count > bytes_left)
@@ -594,7 +594,7 @@ static int __init davinci_acquire_dma_channels(struct 
mmc_davinci_host *host)
         * channel as needed to handle a scatterlist.
         */
        for (i = 0; i < ARRAY_SIZE(host->links); i++) {
-               r = edma_alloc_slot(EDMA_SLOT_ANY);
+               r = edma_alloc_slot(EDMA_CTLR(host->txdma), EDMA_SLOT_ANY);
                if (r < 0) {
                        dev_dbg(mmc_dev(host->mmc), "dma PaRAM alloc --> %d\n",
                                r);
-- 
1.5.6

_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to