Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0815f8ea authored by Tomi Valkeinen's avatar Tomi Valkeinen Committed by Tony Lindgren
Browse files

ARM: OMAP2/3: DMA: implement trans copy and const fill



Implement transparent copy and constant fill features for OMAP2/3.

Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@nokia.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent ebe3b0e7
Loading
Loading
Loading
Loading
+49 −28
Original line number Diff line number Diff line
@@ -310,14 +310,10 @@ EXPORT_SYMBOL(omap_set_dma_transfer_params);

void omap_set_dma_color_mode(int lch, enum omap_dma_color_mode mode, u32 color)
{
	u16 w;

	BUG_ON(omap_dma_in_1510_mode());

	if (cpu_class_is_omap2()) {
		REVISIT_24XX();
		return;
	}
	if (cpu_class_is_omap1()) {
		u16 w;

		w = dma_read(CCR2(lch));
		w &= ~0x03;
@@ -346,6 +342,31 @@ void omap_set_dma_color_mode(int lch, enum omap_dma_color_mode mode, u32 color)
		}
		dma_write(w, LCH_CTRL(lch));
	}

	if (cpu_class_is_omap2()) {
		u32 val;

		val = dma_read(CCR(lch));
		val &= ~((1 << 17) | (1 << 16));

		switch (mode) {
		case OMAP_DMA_CONSTANT_FILL:
			val |= 1 << 16;
			break;
		case OMAP_DMA_TRANSPARENT_COPY:
			val |= 1 << 17;
			break;
		case OMAP_DMA_COLOR_DIS:
			break;
		default:
			BUG();
		}
		dma_write(val, CCR(lch));

		color &= 0xffffff;
		dma_write(color, COLOR(lch));
	}
}
EXPORT_SYMBOL(omap_set_dma_color_mode);

void omap_set_dma_write_mode(int lch, enum omap_dma_write_mode mode)
+1 −0
Original line number Diff line number Diff line
@@ -144,6 +144,7 @@
#define OMAP_DMA4_CSSA_U(n)		0
#define OMAP_DMA4_CDSA_L(n)		0
#define OMAP_DMA4_CDSA_U(n)		0
#define OMAP1_DMA_COLOR(n)		0

/*----------------------------------------------------------------------------*/