diff options
Diffstat (limited to 'drivers/dma/mxs-dma.c')
-rw-r--r-- | drivers/dma/mxs-dma.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/dma/mxs-dma.c b/drivers/dma/mxs-dma.c index 734a4eb84d65..9f02e794b12b 100644 --- a/drivers/dma/mxs-dma.c +++ b/drivers/dma/mxs-dma.c | |||
@@ -101,7 +101,8 @@ struct mxs_dma_ccw { | |||
101 | u32 pio_words[MXS_PIO_WORDS]; | 101 | u32 pio_words[MXS_PIO_WORDS]; |
102 | }; | 102 | }; |
103 | 103 | ||
104 | #define NUM_CCW (int)(PAGE_SIZE / sizeof(struct mxs_dma_ccw)) | 104 | #define CCW_BLOCK_SIZE (4 * PAGE_SIZE) |
105 | #define NUM_CCW (int)(CCW_BLOCK_SIZE / sizeof(struct mxs_dma_ccw)) | ||
105 | 106 | ||
106 | struct mxs_dma_chan { | 107 | struct mxs_dma_chan { |
107 | struct mxs_dma_engine *mxs_dma; | 108 | struct mxs_dma_engine *mxs_dma; |
@@ -354,14 +355,15 @@ static int mxs_dma_alloc_chan_resources(struct dma_chan *chan) | |||
354 | 355 | ||
355 | mxs_chan->chan_irq = data->chan_irq; | 356 | mxs_chan->chan_irq = data->chan_irq; |
356 | 357 | ||
357 | mxs_chan->ccw = dma_alloc_coherent(mxs_dma->dma_device.dev, PAGE_SIZE, | 358 | mxs_chan->ccw = dma_alloc_coherent(mxs_dma->dma_device.dev, |
358 | &mxs_chan->ccw_phys, GFP_KERNEL); | 359 | CCW_BLOCK_SIZE, &mxs_chan->ccw_phys, |
360 | GFP_KERNEL); | ||
359 | if (!mxs_chan->ccw) { | 361 | if (!mxs_chan->ccw) { |
360 | ret = -ENOMEM; | 362 | ret = -ENOMEM; |
361 | goto err_alloc; | 363 | goto err_alloc; |
362 | } | 364 | } |
363 | 365 | ||
364 | memset(mxs_chan->ccw, 0, PAGE_SIZE); | 366 | memset(mxs_chan->ccw, 0, CCW_BLOCK_SIZE); |
365 | 367 | ||
366 | if (mxs_chan->chan_irq != NO_IRQ) { | 368 | if (mxs_chan->chan_irq != NO_IRQ) { |
367 | ret = request_irq(mxs_chan->chan_irq, mxs_dma_int_handler, | 369 | ret = request_irq(mxs_chan->chan_irq, mxs_dma_int_handler, |
@@ -387,7 +389,7 @@ static int mxs_dma_alloc_chan_resources(struct dma_chan *chan) | |||
387 | err_clk: | 389 | err_clk: |
388 | free_irq(mxs_chan->chan_irq, mxs_dma); | 390 | free_irq(mxs_chan->chan_irq, mxs_dma); |
389 | err_irq: | 391 | err_irq: |
390 | dma_free_coherent(mxs_dma->dma_device.dev, PAGE_SIZE, | 392 | dma_free_coherent(mxs_dma->dma_device.dev, CCW_BLOCK_SIZE, |
391 | mxs_chan->ccw, mxs_chan->ccw_phys); | 393 | mxs_chan->ccw, mxs_chan->ccw_phys); |
392 | err_alloc: | 394 | err_alloc: |
393 | return ret; | 395 | return ret; |
@@ -402,7 +404,7 @@ static void mxs_dma_free_chan_resources(struct dma_chan *chan) | |||
402 | 404 | ||
403 | free_irq(mxs_chan->chan_irq, mxs_dma); | 405 | free_irq(mxs_chan->chan_irq, mxs_dma); |
404 | 406 | ||
405 | dma_free_coherent(mxs_dma->dma_device.dev, PAGE_SIZE, | 407 | dma_free_coherent(mxs_dma->dma_device.dev, CCW_BLOCK_SIZE, |
406 | mxs_chan->ccw, mxs_chan->ccw_phys); | 408 | mxs_chan->ccw, mxs_chan->ccw_phys); |
407 | 409 | ||
408 | clk_disable_unprepare(mxs_dma->clk); | 410 | clk_disable_unprepare(mxs_dma->clk); |