aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-omap
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@nokia.com>2009-05-28 16:23:51 -0400
committerTony Lindgren <tony@atomide.com>2009-05-28 16:23:51 -0400
commit0815f8eaae6d11b9dae6c2ff0202d7945f8d7cd2 (patch)
tree5bd7fee72b2609ad33ec2d2af72d0d2a8f9650ce /arch/arm/plat-omap
parentebe3b0e787a538638410088227e0a87e3b4b6c00 (diff)
ARM: OMAP2/3: DMA: implement trans copy and const fill
Implement transparent copy and constant fill features for OMAP2/3. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/plat-omap')
-rw-r--r--arch/arm/plat-omap/dma.c77
-rw-r--r--arch/arm/plat-omap/include/mach/dma.h1
2 files changed, 50 insertions, 28 deletions
diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
index 7fc8c045ad5d..58d98ad981e4 100644
--- a/arch/arm/plat-omap/dma.c
+++ b/arch/arm/plat-omap/dma.c
@@ -310,41 +310,62 @@ EXPORT_SYMBOL(omap_set_dma_transfer_params);
310 310
311void omap_set_dma_color_mode(int lch, enum omap_dma_color_mode mode, u32 color) 311void omap_set_dma_color_mode(int lch, enum omap_dma_color_mode mode, u32 color)
312{ 312{
313 u16 w;
314
315 BUG_ON(omap_dma_in_1510_mode()); 313 BUG_ON(omap_dma_in_1510_mode());
316 314
317 if (cpu_class_is_omap2()) { 315 if (cpu_class_is_omap1()) {
318 REVISIT_24XX(); 316 u16 w;
319 return;
320 }
321 317
322 w = dma_read(CCR2(lch)); 318 w = dma_read(CCR2(lch));
323 w &= ~0x03; 319 w &= ~0x03;
324 320
325 switch (mode) { 321 switch (mode) {
326 case OMAP_DMA_CONSTANT_FILL: 322 case OMAP_DMA_CONSTANT_FILL:
327 w |= 0x01; 323 w |= 0x01;
328 break; 324 break;
329 case OMAP_DMA_TRANSPARENT_COPY: 325 case OMAP_DMA_TRANSPARENT_COPY:
330 w |= 0x02; 326 w |= 0x02;
331 break; 327 break;
332 case OMAP_DMA_COLOR_DIS: 328 case OMAP_DMA_COLOR_DIS:
333 break; 329 break;
334 default: 330 default:
335 BUG(); 331 BUG();
332 }
333 dma_write(w, CCR2(lch));
334
335 w = dma_read(LCH_CTRL(lch));
336 w &= ~0x0f;
337 /* Default is channel type 2D */
338 if (mode) {
339 dma_write((u16)color, COLOR_L(lch));
340 dma_write((u16)(color >> 16), COLOR_U(lch));
341 w |= 1; /* Channel type G */
342 }
343 dma_write(w, LCH_CTRL(lch));
336 } 344 }
337 dma_write(w, CCR2(lch));
338 345
339 w = dma_read(LCH_CTRL(lch)); 346 if (cpu_class_is_omap2()) {
340 w &= ~0x0f; 347 u32 val;
341 /* Default is channel type 2D */ 348
342 if (mode) { 349 val = dma_read(CCR(lch));
343 dma_write((u16)color, COLOR_L(lch)); 350 val &= ~((1 << 17) | (1 << 16));
344 dma_write((u16)(color >> 16), COLOR_U(lch)); 351
345 w |= 1; /* Channel type G */ 352 switch (mode) {
353 case OMAP_DMA_CONSTANT_FILL:
354 val |= 1 << 16;
355 break;
356 case OMAP_DMA_TRANSPARENT_COPY:
357 val |= 1 << 17;
358 break;
359 case OMAP_DMA_COLOR_DIS:
360 break;
361 default:
362 BUG();
363 }
364 dma_write(val, CCR(lch));
365
366 color &= 0xffffff;
367 dma_write(color, COLOR(lch));
346 } 368 }
347 dma_write(w, LCH_CTRL(lch));
348} 369}
349EXPORT_SYMBOL(omap_set_dma_color_mode); 370EXPORT_SYMBOL(omap_set_dma_color_mode);
350 371
diff --git a/arch/arm/plat-omap/include/mach/dma.h b/arch/arm/plat-omap/include/mach/dma.h
index 54fe9665b182..35fefdb0b79a 100644
--- a/arch/arm/plat-omap/include/mach/dma.h
+++ b/arch/arm/plat-omap/include/mach/dma.h
@@ -144,6 +144,7 @@
144#define OMAP_DMA4_CSSA_U(n) 0 144#define OMAP_DMA4_CSSA_U(n) 0
145#define OMAP_DMA4_CDSA_L(n) 0 145#define OMAP_DMA4_CDSA_L(n) 0
146#define OMAP_DMA4_CDSA_U(n) 0 146#define OMAP_DMA4_CDSA_U(n) 0
147#define OMAP1_DMA_COLOR(n) 0
147 148
148/*----------------------------------------------------------------------------*/ 149/*----------------------------------------------------------------------------*/
149 150