]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
OMAP: DMA: Fix CCR programming for request line > 63
authorAnand Gadiyar <gadiyar@ti.com>
Mon, 10 Nov 2008 11:08:17 +0000 (16:38 +0530)
committerTony Lindgren <tony@atomide.com>
Thu, 8 Jan 2009 12:46:04 +0000 (14:46 +0200)
Bug in existing code causes synchro control to be set +32 if request
line greater than 63 is used.

Reported by Wenbiao Wang

Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
+++ linux-omap-2.6/arch/arm/plat-omap/dma.c 2009-01-08 14:44:46.000000000 +0200
@@ -279,10 +279,7 @@ void omap_set_dma_transfer_params(int lc

  val = dma_read(CCR(lch));
  val &= ~(3 << 19);
- if (dma_trigger > 63)
- val |= 1 << 20;
- if (dma_trigger > 31)
- val |= 1 << 19;
+ val |= ((dma_trigger & ~(0x1f)) << 14);

  val &= ~(0x1f);
  val |= (dma_trigger & 0x1f);
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/plat-omap/dma.c

index 9d8d28ca3f3e854819f9be0b7b32fb4d8070c1d6..922985ef32bcb2b407fe843292fcd7b2e7afac06 100644 (file)
@@ -279,10 +279,7 @@ void omap_set_dma_transfer_params(int lch, int data_type, int elem_count,
 
                val = dma_read(CCR(lch));
                val &= ~(3 << 19);
-               if (dma_trigger > 63)
-                       val |= 1 << 20;
-               if (dma_trigger > 31)
-                       val |= 1 << 19;
+               val |= ((dma_trigger & ~(0x1f)) << 14);
 
                val &= ~(0x1f);
                val |= (dma_trigger & 0x1f);