linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] dmaengine: at_hdmac: modify way to use interrupts
@ 2011-04-01 17:19 Nicolas Ferre
  2011-04-01 17:19 ` [PATCH 2/5] dmaengine: at_hdmac: add cyclic DMA operation support Nicolas Ferre
                   ` (8 more replies)
  0 siblings, 9 replies; 20+ messages in thread
From: Nicolas Ferre @ 2011-04-01 17:19 UTC (permalink / raw)
  To: linux-arm-kernel

Now we use Buffer Transfer Completed interrupts. If we
want a chained buffer completed information, we setup the
ATC_IEN bit in CTRLB register in the lli.
This is done by set_desc_eol() function and used by
memcpy/slave_sg functions.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
---
 drivers/dma/at_hdmac.c      |    4 ++--
 drivers/dma/at_hdmac_regs.h |   11 ++++++++---
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
index 3d7d705..13050e6 100644
--- a/drivers/dma/at_hdmac.c
+++ b/drivers/dma/at_hdmac.c
@@ -464,7 +464,7 @@ static irqreturn_t at_dma_interrupt(int irq, void *dev_id)
 
 		for (i = 0; i < atdma->dma_common.chancnt; i++) {
 			atchan = &atdma->chan[i];
-			if (pending & (AT_DMA_CBTC(i) | AT_DMA_ERR(i))) {
+			if (pending & (AT_DMA_BTC(i) | AT_DMA_ERR(i))) {
 				if (pending & AT_DMA_ERR(i)) {
 					/* Disable channel on AHB error */
 					dma_writel(atdma, CHDR, atchan->mask);
@@ -549,7 +549,7 @@ atc_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dest, dma_addr_t src,
 	}
 
 	ctrla =   ATC_DEFAULT_CTRLA;
-	ctrlb =   ATC_DEFAULT_CTRLB
+	ctrlb =   ATC_DEFAULT_CTRLB | ATC_IEN
 		| ATC_SRC_ADDR_MODE_INCR
 		| ATC_DST_ADDR_MODE_INCR
 		| ATC_FC_MEM2MEM;
diff --git a/drivers/dma/at_hdmac_regs.h b/drivers/dma/at_hdmac_regs.h
index 495457e..8303306 100644
--- a/drivers/dma/at_hdmac_regs.h
+++ b/drivers/dma/at_hdmac_regs.h
@@ -309,8 +309,8 @@ static void atc_setup_irq(struct at_dma_chan *atchan, int on)
 	struct at_dma	*atdma = to_at_dma(atchan->chan_common.device);
 	u32		ebci;
 
-	/* enable interrupts on buffer chain completion & error */
-	ebci =    AT_DMA_CBTC(atchan->chan_common.chan_id)
+	/* enable interrupts on buffer transfer completion & error */
+	ebci =    AT_DMA_BTC(atchan->chan_common.chan_id)
 		| AT_DMA_ERR(atchan->chan_common.chan_id);
 	if (on)
 		dma_writel(atdma, EBCIER, ebci);
@@ -347,7 +347,12 @@ static inline int atc_chan_is_enabled(struct at_dma_chan *atchan)
  */
 static void set_desc_eol(struct at_desc *desc)
 {
-	desc->lli.ctrlb |= ATC_SRC_DSCR_DIS | ATC_DST_DSCR_DIS;
+	u32 ctrlb = desc->lli.ctrlb;
+
+	ctrlb &= ~ATC_IEN;
+	ctrlb |= ATC_SRC_DSCR_DIS | ATC_DST_DSCR_DIS;
+
+	desc->lli.ctrlb = ctrlb;
 	desc->lli.dscr = 0;
 }
 
-- 
1.7.3

^ permalink raw reply related	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2011-05-02 10:14 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-01 17:19 [PATCH 1/5] dmaengine: at_hdmac: modify way to use interrupts Nicolas Ferre
2011-04-01 17:19 ` [PATCH 2/5] dmaengine: at_hdmac: add cyclic DMA operation support Nicolas Ferre
2011-04-06 10:08   ` Koul, Vinod
2011-04-06 12:50     ` Nicolas Ferre
2011-04-06 14:02       ` Koul, Vinod
2011-04-06 15:45         ` Nicolas Ferre
2011-04-01 17:19 ` [PATCH 3/5] dmaengine: at_hdmac: debug information sg_len for prep_slave_sg Nicolas Ferre
2011-04-01 17:19 ` [PATCH 4/5] dmaengine: at_hdmac: remove channel status testing in tasklet Nicolas Ferre
2011-04-01 17:19 ` [PATCH 5/5] dmaengine: at_hdmac: specialize AHB interfaces to optimize transfers Nicolas Ferre
2011-04-22 17:41 ` [PATCH v2 1/5] dmaengine: at_hdmac: modify way to use interrupts Nicolas Ferre
2011-04-26  4:02   ` Koul, Vinod
2011-04-26  4:06     ` Koul, Vinod
2011-04-26  4:34     ` Jean-Christophe PLAGNIOL-VILLARD
2011-04-26  4:24       ` Koul, Vinod
2011-04-30 14:57         ` [PATCH v3 4/5] dmaengine: at_hdmac: remove channel status testing in tasklet Nicolas Ferre
     [not found]         ` <35f32b2bdf51d9d5867ca352ce96d786c74a58eb.1304174965.git.nicolas.ferre@atmel.com>
2011-05-02 10:14           ` [PATCH v3 1/5] dmaengine: at_hdmac: modify way to use interrupts Koul, Vinod
2011-04-22 17:41 ` [PATCH v2 2/5] dmaengine: at_hdmac: add cyclic DMA operation support Nicolas Ferre
2011-04-22 17:41 ` [PATCH v2 3/5] dmaengine: at_hdmac: debug information sg_len for prep_slave_sg Nicolas Ferre
2011-04-22 17:42 ` [PATCH v2 4/5] dmaengine: at_hdmac: remove channel status testing in tasklet Nicolas Ferre
2011-04-22 17:42 ` [PATCH v2 5/5] dmaengine: at_hdmac: specialize AHB interfaces to optimize transfers Nicolas Ferre

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).