ARM: edma: Add function to manually trigger an EDMA channel
authorJoel Fernandes <joelf@ti.com>
Thu, 29 Aug 2013 23:05:42 +0000 (18:05 -0500)
committerVinod Koul <vinod.koul@intel.com>
Wed, 4 Sep 2013 13:08:46 +0000 (18:38 +0530)
Manual trigger for events missed as a result of splitting a
scatter gather list and DMA'ing it in batches. Add a helper
function to trigger a channel incase any such events are missed.

Signed-off-by: Joel Fernandes <joelf@ti.com>
Acked-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
arch/arm/common/edma.c
include/linux/platform_data/edma.h

index 39ad030ac0c72b529b9cf3166a003b9feaa1f879..117f955a2a063b7e57cbbd0a05806ce3413814a7 100644 (file)
@@ -1235,6 +1235,23 @@ void edma_resume(unsigned channel)
 }
 EXPORT_SYMBOL(edma_resume);
 
+int edma_trigger_channel(unsigned channel)
+{
+       unsigned ctlr;
+       unsigned int mask;
+
+       ctlr = EDMA_CTLR(channel);
+       channel = EDMA_CHAN_SLOT(channel);
+       mask = BIT(channel & 0x1f);
+
+       edma_shadow0_write_array(ctlr, SH_ESR, (channel >> 5), mask);
+
+       pr_debug("EDMA: ESR%d %08x\n", (channel >> 5),
+                edma_shadow0_read_array(ctlr, SH_ESR, (channel >> 5)));
+       return 0;
+}
+EXPORT_SYMBOL(edma_trigger_channel);
+
 /**
  * edma_start - start dma on a channel
  * @channel: channel being activated
index 57300fd7cc03435a55c8824309c52594e926e66f..179fb91bb5f2eaef7354e37411628f90a6c02335 100644 (file)
@@ -180,4 +180,6 @@ struct edma_soc_info {
        const s16       (*xbar_chans)[2];
 };
 
+int edma_trigger_channel(unsigned);
+
 #endif