Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 297536
b: refs/heads/master
c: bdc0c75
h: refs/heads/master
v: v3
  • Loading branch information
Javier Martin authored and Vinod Koul committed Mar 26, 2012
1 parent 255e619 commit 9625c77
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 34 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3b4b6dfc202dc5bedb03f2fae4ccc3f5b95dd563
refs/heads/master: bdc0c7534c80c479b2336aed3e4016f4743f4853
46 changes: 13 additions & 33 deletions trunk/drivers/dma/imx-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,32 +313,6 @@ static void imxdma_disable_hw(struct imxdma_channel *imxdmac)
local_irq_restore(flags);
}

static int
imxdma_config_channel_hw(struct imxdma_channel *imxdmac, unsigned int config_port,
unsigned int config_mem, unsigned int dmareq, int hw_chaining)
{
int channel = imxdmac->channel;
u32 dreq = 0;

imxdmac->internal.hw_chaining = 0;

if (hw_chaining) {
imxdmac->internal.hw_chaining = 1;
if (!imxdma_hw_chain(&imxdmac->internal))
return -EINVAL;
}

if (dmareq)
dreq = CCR_REN;

imxdmac->internal.ccr_from_device = config_port | (config_mem << 2) | dreq;
imxdmac->internal.ccr_to_device = config_mem | (config_port << 2) | dreq;

imx_dmav1_writel(dmareq, DMA_RSSR(channel));

return 0;
}

static int
imxdma_setup_sg_hw(struct imxdma_desc *d,
struct scatterlist *sg, unsigned int sgcount,
Expand Down Expand Up @@ -628,7 +602,6 @@ static int imxdma_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
{
struct imxdma_channel *imxdmac = to_imxdma_chan(chan);
struct dma_slave_config *dmaengine_cfg = (void *)arg;
int ret;
unsigned long flags;
unsigned int mode = 0;

Expand Down Expand Up @@ -664,13 +637,20 @@ static int imxdma_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
mode = IMX_DMA_MEMSIZE_32;
break;
}
ret = imxdma_config_channel_hw(imxdmac,
mode | IMX_DMA_TYPE_FIFO,
IMX_DMA_MEMSIZE_32 | IMX_DMA_TYPE_LINEAR,
imxdmac->dma_request, 1);

if (ret)
return ret;
imxdmac->internal.hw_chaining = 1;
if (!imxdma_hw_chain(&imxdmac->internal))
return -EINVAL;
imxdmac->internal.ccr_from_device =
(mode | IMX_DMA_TYPE_FIFO) |
((IMX_DMA_MEMSIZE_32 | IMX_DMA_TYPE_LINEAR) << 2) |
CCR_REN;
imxdmac->internal.ccr_to_device =
(IMX_DMA_MEMSIZE_32 | IMX_DMA_TYPE_LINEAR) |
((mode | IMX_DMA_TYPE_FIFO) << 2) | CCR_REN;
imx_dmav1_writel(imxdmac->dma_request,
DMA_RSSR(imxdmac->channel));

/* Set burst length */
imx_dmav1_writel(imxdmac->watermark_level * imxdmac->word_size,
DMA_BLR(imxdmac->channel));
Expand Down

0 comments on commit 9625c77

Please sign in to comment.