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 | |
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>
-rw-r--r-- | drivers/dma/Kconfig | 3 | ||||
-rw-r--r-- | drivers/dma/pl330.c | 14 | ||||
-rw-r--r-- | include/linux/amba/pl330.h | 6 |
3 files changed, 12 insertions, 11 deletions
diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig index 2e3b3d38c465..ab8f469f5cf8 100644 --- a/drivers/dma/Kconfig +++ b/drivers/dma/Kconfig | |||
@@ -193,7 +193,8 @@ config ARCH_HAS_ASYNC_TX_FIND_CHANNEL | |||
193 | config PL330_DMA | 193 | config PL330_DMA |
194 | tristate "DMA API Driver for PL330" | 194 | tristate "DMA API Driver for PL330" |
195 | select DMA_ENGINE | 195 | select DMA_ENGINE |
196 | depends on PL330 | 196 | depends on ARM_AMBA |
197 | select PL330 | ||
197 | help | 198 | help |
198 | Select if your platform has one or more PL330 DMACs. | 199 | Select if your platform has one or more PL330 DMACs. |
199 | You need to provide platform specific settings via | 200 | You need to provide platform specific settings via |
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 | ||
diff --git a/include/linux/amba/pl330.h b/include/linux/amba/pl330.h index cbee7de7dd36..d12f077a6daf 100644 --- a/include/linux/amba/pl330.h +++ b/include/linux/amba/pl330.h | |||
@@ -19,12 +19,8 @@ struct dma_pl330_peri { | |||
19 | * Peri_Req i/f of the DMAC that is | 19 | * Peri_Req i/f of the DMAC that is |
20 | * peripheral could be reached from. | 20 | * peripheral could be reached from. |
21 | */ | 21 | */ |
22 | u8 peri_id; /* {0, 31} */ | 22 | u8 peri_id; /* specific dma id */ |
23 | enum pl330_reqtype rqtype; | 23 | enum pl330_reqtype rqtype; |
24 | |||
25 | /* For M->D and D->M Channels */ | ||
26 | int burst_sz; /* in power of 2 */ | ||
27 | dma_addr_t fifo_addr; | ||
28 | }; | 24 | }; |
29 | 25 | ||
30 | struct dma_pl330_platdata { | 26 | struct dma_pl330_platdata { |