ARM: OMAP: DMA: Add support for DMA channel self linking on OMAP1510
authorJanusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Sun, 23 Aug 2009 15:56:12 +0000 (17:56 +0200)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 24 Aug 2009 22:05:25 +0000 (23:05 +0100)
Implement DMA channel self linking on OMAP1510 using AUTO_INIT and REPEAT
flags of the DMA CCR register.

Created against linux-2.6.31-rc5.

Tested on Amstrad Delta.

Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
arch/arm/plat-omap/dma.c

index def14ec265b369f7929ea5bd841f4e97a6ac5b38..da4cc5288db0a07a5ca36ad9cfbc26f87ca8c47a 100644 (file)
@@ -1125,6 +1125,11 @@ int omap_dma_running(void)
 void omap_dma_link_lch(int lch_head, int lch_queue)
 {
        if (omap_dma_in_1510_mode()) {
+               if (lch_head == lch_queue) {
+                       dma_write(dma_read(CCR(lch_head)) | (3 << 8),
+                                                               CCR(lch_head));
+                       return;
+               }
                printk(KERN_ERR "DMA linking is not supported in 1510 mode\n");
                BUG();
                return;
@@ -1147,6 +1152,11 @@ EXPORT_SYMBOL(omap_dma_link_lch);
 void omap_dma_unlink_lch(int lch_head, int lch_queue)
 {
        if (omap_dma_in_1510_mode()) {
+               if (lch_head == lch_queue) {
+                       dma_write(dma_read(CCR(lch_head)) & ~(3 << 8),
+                                                               CCR(lch_head));
+                       return;
+               }
                printk(KERN_ERR "DMA linking is not supported in 1510 mode\n");
                BUG();
                return;