From fa589f1ad83e8795ba0509e7899dd1a6926c5fbd Mon Sep 17 00:00:00 2001
From: Philip Balister <philip@opensdr.com>
Date: Thu, 22 Apr 2010 19:41:58 -0700
Subject: [PATCH 2/3] Add functions to dma.c to set address and length for src and dest.

---
 arch/arm/plat-omap/dma.c              |   30 ++++++++++++++++++++++++++++++
 arch/arm/plat-omap/include/plat/dma.h |    4 ++++
 2 files changed, 34 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
index c4b2b47..f28f756 100644
--- a/arch/arm/plat-omap/dma.c
+++ b/arch/arm/plat-omap/dma.c
@@ -471,6 +471,21 @@ void omap_set_dma_src_burst_mode(int lch, enum omap_dma_burst_mode burst_mode)
 }
 EXPORT_SYMBOL(omap_set_dma_src_burst_mode);
 
+void omap_set_dma_src_addr_size(int lch, unsigned int addr, int elem_count)
+{
+
+	if (cpu_class_is_omap1()) {
+		p->dma_write(addr >> 16, CSSA, lch);
+		//p->dma_write((u16)addr, CSSA_L, lch);
+	}
+
+	if (cpu_class_is_omap2())
+		p->dma_write(addr, CSSA, lch);
+
+	p->dma_write(elem_count, CEN, lch);
+}
+EXPORT_SYMBOL_GPL(omap_set_dma_src_addr_size);
+
 /* Note that dest_port is only for OMAP1 */
 void omap_set_dma_dest_params(int lch, int dest_port, int dest_amode,
 			      unsigned long dest_start,
@@ -561,6 +576,21 @@ void omap_set_dma_dest_burst_mode(int lch, enum omap_dma_burst_mode burst_mode)
 }
 EXPORT_SYMBOL(omap_set_dma_dest_burst_mode);
 
+void omap_set_dma_dest_addr_size(int lch, unsigned int addr, int elem_count)
+{
+
+	if (cpu_class_is_omap1()) {
+		p->dma_write(addr >> 16, CDSA, lch);
+		//p->dma_write((u16)addr, CDSA_L, lch);
+	}
+
+	if (cpu_class_is_omap2())
+		p->dma_write(addr, CDSA, lch);
+
+	p->dma_write(elem_count, CEN, lch);
+}
+EXPORT_SYMBOL_GPL(omap_set_dma_dest_addr_size);
+
 static inline void omap_enable_channel_irq(int lch)
 {
 	u32 status;
diff --git a/arch/arm/plat-omap/include/plat/dma.h b/arch/arm/plat-omap/include/plat/dma.h
index d1c916f..1e7243e 100644
--- a/arch/arm/plat-omap/include/plat/dma.h
+++ b/arch/arm/plat-omap/include/plat/dma.h
@@ -462,6 +462,8 @@ extern void omap_set_dma_src_index(int lch, int eidx, int fidx);
 extern void omap_set_dma_src_data_pack(int lch, int enable);
 extern void omap_set_dma_src_burst_mode(int lch,
 					enum omap_dma_burst_mode burst_mode);
+extern void omap_set_dma_src_addr_size(int lch, unsigned int addr,
+				int elem_count);
 
 extern void omap_set_dma_dest_params(int lch, int dest_port, int dest_amode,
 				     unsigned long dest_start,
@@ -470,6 +472,8 @@ extern void omap_set_dma_dest_index(int lch, int eidx, int fidx);
 extern void omap_set_dma_dest_data_pack(int lch, int enable);
 extern void omap_set_dma_dest_burst_mode(int lch,
 					 enum omap_dma_burst_mode burst_mode);
+extern void omap_set_dma_dest_addr_size(int lch, unsigned int addr,
+					int elem_count);
 
 extern void omap_set_dma_params(int lch,
 				struct omap_dma_channel_params *params);
-- 
1.6.6.1

