diff options
author | Boojin Kim <boojin.kim@samsung.com> | 2011-09-01 20:44:30 -0400 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2011-09-14 01:40:01 -0400 |
commit | 1b9bb715e7c4c189c4215a11a09e2ccb16598d86 (patch) | |
tree | e274c2a58ec31185e0871255a5fd64c177ee4898 /drivers/dma/pl330.c | |
parent | a2f5203fec3c06d68a6bb45ad41f2adebf9ac5e0 (diff) |
DMA: PL330: Update PL330 DMA API driver
This patch updates following 3 items.
1. Removes unneccessary code.
2. Add AMBA, PL330 configuration
3. Change the meaning of 'peri_id' variable
from PL330 event number to specific dma id by user.
Signed-off-by: Boojin Kim <boojin.kim@samsung.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma/pl330.c')
-rw-r--r-- | drivers/dma/pl330.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c index 0b99af18f9a1..d5829c734fad 100644 --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/amba/bus.h> | 18 | #include <linux/amba/bus.h> |
19 | #include <linux/amba/pl330.h> | 19 | #include <linux/amba/pl330.h> |
20 | #include <linux/pm_runtime.h> | 20 | #include <linux/pm_runtime.h> |
21 | #include <linux/scatterlist.h> | ||
21 | 22 | ||
22 | #define NR_DEFAULT_DESC 16 | 23 | #define NR_DEFAULT_DESC 16 |
23 | 24 | ||
@@ -69,6 +70,10 @@ struct dma_pl330_chan { | |||
69 | * NULL if the channel is available to be acquired. | 70 | * NULL if the channel is available to be acquired. |
70 | */ | 71 | */ |
71 | void *pl330_chid; | 72 | void *pl330_chid; |
73 | |||
74 | /* For D-to-M and M-to-D channels */ | ||
75 | int burst_sz; /* the peripheral fifo width */ | ||
76 | dma_addr_t fifo_addr; | ||
72 | }; | 77 | }; |
73 | 78 | ||
74 | struct dma_pl330_dmac { | 79 | struct dma_pl330_dmac { |
@@ -456,7 +461,7 @@ static struct dma_pl330_desc *pl330_get_desc(struct dma_pl330_chan *pch) | |||
456 | 461 | ||
457 | if (peri) { | 462 | if (peri) { |
458 | desc->req.rqtype = peri->rqtype; | 463 | desc->req.rqtype = peri->rqtype; |
459 | desc->req.peri = peri->peri_id; | 464 | desc->req.peri = pch->chan.chan_id; |
460 | } else { | 465 | } else { |
461 | desc->req.rqtype = MEMTOMEM; | 466 | desc->req.rqtype = MEMTOMEM; |
462 | desc->req.peri = 0; | 467 | desc->req.peri = 0; |
@@ -582,7 +587,7 @@ pl330_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl, | |||
582 | struct dma_pl330_peri *peri = chan->private; | 587 | struct dma_pl330_peri *peri = chan->private; |
583 | struct scatterlist *sg; | 588 | struct scatterlist *sg; |
584 | unsigned long flags; | 589 | unsigned long flags; |
585 | int i, burst_size; | 590 | int i; |
586 | dma_addr_t addr; | 591 | dma_addr_t addr; |
587 | 592 | ||
588 | if (unlikely(!pch || !sgl || !sg_len || !peri)) | 593 | if (unlikely(!pch || !sgl || !sg_len || !peri)) |
@@ -598,8 +603,7 @@ pl330_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl, | |||
598 | return NULL; | 603 | return NULL; |
599 | } | 604 | } |
600 | 605 | ||
601 | addr = peri->fifo_addr; | 606 | addr = pch->fifo_addr; |
602 | burst_size = peri->burst_sz; | ||
603 | 607 | ||
604 | first = NULL; | 608 | first = NULL; |
605 | 609 | ||
@@ -647,7 +651,7 @@ pl330_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl, | |||
647 | sg_dma_address(sg), addr, sg_dma_len(sg)); | 651 | sg_dma_address(sg), addr, sg_dma_len(sg)); |
648 | } | 652 | } |
649 | 653 | ||
650 | desc->rqcfg.brst_size = burst_size; | 654 | desc->rqcfg.brst_size = pch->burst_sz; |
651 | desc->rqcfg.brst_len = 1; | 655 | desc->rqcfg.brst_len = 1; |
652 | } | 656 | } |
653 | 657 | ||