]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
ARM i.MX dma: Fix burstsize settings
authorSascha Hauer <s.hauer@pengutronix.de>
Wed, 6 Jul 2011 09:18:33 +0000 (11:18 +0200)
committerSascha Hauer <s.hauer@pengutronix.de>
Thu, 7 Jul 2011 07:55:50 +0000 (09:55 +0200)
dmaengine expects the maxburst parameter in words, not bytes.
The imxdma driver and its users do this wrong. Fix this.

As a side note the imx-pcm-dma-mx2 driver was 'fixed' to work
with imx-dma. This broke the driver with imx-sdma support which
correctly takes the maxburst parameter in words. This patch
puts the sdma based sound back to work.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
drivers/dma/imx-dma.c
drivers/mmc/host/mxcmmc.c
sound/soc/imx/imx-pcm-dma-mx2.c

index e18eaabe92b97bea100b6baa5528078696abb1ec..d99f71c356b51cb5387423b22c49290ea26a1869 100644 (file)
@@ -135,7 +135,8 @@ static int imxdma_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
                if (ret)
                        return ret;
 
-               imx_dma_config_burstlen(imxdmac->imxdma_channel, imxdmac->watermark_level);
+               imx_dma_config_burstlen(imxdmac->imxdma_channel,
+                               imxdmac->watermark_level * imxdmac->word_size);
 
                return 0;
        default:
index cc20e025932593db93deb84d3e27f05bf9ed89c0..14aa213b00da3a3b2a8d5e332528bb2d952e44a9 100644 (file)
@@ -715,13 +715,13 @@ static void mxcmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
        int burstlen, ret;
 
        /*
-        * use burstlen of 64 in 4 bit mode (--> reg value  0)
-        * use burstlen of 16 in 1 bit mode (--> reg value 16)
+        * use burstlen of 64 (16 words) in 4 bit mode (--> reg value  0)
+        * use burstlen of 16 (4 words) in 1 bit mode (--> reg value 16)
         */
        if (ios->bus_width == MMC_BUS_WIDTH_4)
-               burstlen = 64;
-       else
                burstlen = 16;
+       else
+               burstlen = 4;
 
        if (mxcmci_use_dma(host) && burstlen != host->burstlen) {
                host->burstlen = burstlen;
index aab7765f401a0904397c9c22a801fc10670b73f4..b2ed764fd89623470ddd8c766b428e195cd11483 100644 (file)
@@ -110,12 +110,12 @@ static int imx_ssi_dma_alloc(struct snd_pcm_substream *substream,
                slave_config.direction = DMA_TO_DEVICE;
                slave_config.dst_addr = dma_params->dma_addr;
                slave_config.dst_addr_width = buswidth;
-               slave_config.dst_maxburst = dma_params->burstsize * buswidth;
+               slave_config.dst_maxburst = dma_params->burstsize;
        } else {
                slave_config.direction = DMA_FROM_DEVICE;
                slave_config.src_addr = dma_params->dma_addr;
                slave_config.src_addr_width = buswidth;
-               slave_config.src_maxburst = dma_params->burstsize * buswidth;
+               slave_config.src_maxburst = dma_params->burstsize;
        }
 
        ret = dmaengine_slave_config(iprtd->dma_chan, &slave_config);