[PATCH] OMAP: DMA: Add API for setting channel dest addr

2010-03-02 Thread Manjunatha GK
The new API - omap_set_dma_dst_pos(int lch, int value) is added
for setting channel destination address in CPC/CDAC register

Cc: Tony Lindgren t...@atomide.com
Cc: S, Venkatraman svenk...@ti.com
Signed-off-by: Manjunatha GK manj...@ti.com
Signed-off-by: Govindraj R govindraj.r...@ti.com
---
 arch/arm/plat-omap/dma.c  |   17 +
 arch/arm/plat-omap/include/plat/dma.h |1 +
 2 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
index 2ab224c..9a2a5c4 100644
--- a/arch/arm/plat-omap/dma.c
+++ b/arch/arm/plat-omap/dma.c
@@ -1109,6 +1109,23 @@ dma_addr_t omap_get_dma_dst_pos(int lch)
 }
 EXPORT_SYMBOL(omap_get_dma_dst_pos);
 
+/**
+ * omap_set_dma_dst_pos() - Set DMA channel destination address
+ * @arg1:  lch  DMA logical channel number
+ * @arg2:  valueValue to write into CDAC register
+ *
+ * Writes value into the register CPC/CDAC
+ */
+void omap_set_dma_dst_pos(int lch, int value)
+{
+   if (cpu_is_omap15xx())
+   dma_write(CPC(lch), value);
+   else
+   dma_write(CDAC(lcd), value);
+
+}
+EXPORT_SYMBOL(omap_set_dma_dst_pos);
+
 int omap_get_dma_active_status(int lch)
 {
return (dma_read(CCR(lch))  OMAP_DMA_CCR_EN) != 0;
diff --git a/arch/arm/plat-omap/include/plat/dma.h 
b/arch/arm/plat-omap/include/plat/dma.h
index 02232ca..3b6e43e 100644
--- a/arch/arm/plat-omap/include/plat/dma.h
+++ b/arch/arm/plat-omap/include/plat/dma.h
@@ -509,6 +509,7 @@ extern int omap_set_dma_callback(int lch,
void *data);
 extern dma_addr_t omap_get_dma_src_pos(int lch);
 extern dma_addr_t omap_get_dma_dst_pos(int lch);
+extern void omap_set_dma_dst_pos(int lch, int value);
 extern void omap_clear_dma(int lch);
 extern int omap_get_dma_active_status(int lch);
 extern int omap_dma_running(void);
-- 
1.6.0.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH] OMAP: DMA: Add API for setting channel dest addr

2010-03-02 Thread Shilimkar, Santosh
Manju,
Is this patch can build?

 -Original Message-
 From: linux-omap-ow...@vger.kernel.org 
 [mailto:linux-omap-ow...@vger.kernel.org] On Behalf Of G,
 Manjunath Kondaiah
 Sent: Tuesday, March 02, 2010 3:46 PM
 To: linux-omap@vger.kernel.org
 Cc: G, Manjunath Kondaiah; Tony Lindgren; S, Venkatraman; Raja, Govindraj
 Subject: [PATCH] OMAP: DMA: Add API for setting channel dest addr
 
 The new API - omap_set_dma_dst_pos(int lch, int value) is added
 for setting channel destination address in CPC/CDAC register
 
 Cc: Tony Lindgren t...@atomide.com
 Cc: S, Venkatraman svenk...@ti.com
 Signed-off-by: Manjunatha GK manj...@ti.com
 Signed-off-by: Govindraj R govindraj.r...@ti.com
 ---
  arch/arm/plat-omap/dma.c  |   17 +
  arch/arm/plat-omap/include/plat/dma.h |1 +
  2 files changed, 18 insertions(+), 0 deletions(-)
 
 diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
 index 2ab224c..9a2a5c4 100644
 --- a/arch/arm/plat-omap/dma.c
 +++ b/arch/arm/plat-omap/dma.c
 @@ -1109,6 +1109,23 @@ dma_addr_t omap_get_dma_dst_pos(int lch)
  }
  EXPORT_SYMBOL(omap_get_dma_dst_pos);
 
 +/**
 + * omap_set_dma_dst_pos() - Set DMA channel destination address
 + * @arg1:  lch  DMA logical channel number
 + * @arg2:  valueValue to write into CDAC register
 + *
 + * Writes value into the register CPC/CDAC
 + */
 +void omap_set_dma_dst_pos(int lch, int value)
 +{
 + if (cpu_is_omap15xx())
 + dma_write(CPC(lch), value);
 + else
 + dma_write(CDAC(lcd), value);

Should be dma_write(CDAC(lch), value);
 +
 +}
 +EXPORT_SYMBOL(omap_set_dma_dst_pos);
 +
  int omap_get_dma_active_status(int lch)
  {
   return (dma_read(CCR(lch))  OMAP_DMA_CCR_EN) != 0;
 diff --git a/arch/arm/plat-omap/include/plat/dma.h 
 b/arch/arm/plat-omap/include/plat/dma.h
 index 02232ca..3b6e43e 100644
 --- a/arch/arm/plat-omap/include/plat/dma.h
 +++ b/arch/arm/plat-omap/include/plat/dma.h
 @@ -509,6 +509,7 @@ extern int omap_set_dma_callback(int lch,
   void *data);
  extern dma_addr_t omap_get_dma_src_pos(int lch);
  extern dma_addr_t omap_get_dma_dst_pos(int lch);
 +extern void omap_set_dma_dst_pos(int lch, int value);
  extern void omap_clear_dma(int lch);
  extern int omap_get_dma_active_status(int lch);
  extern int omap_dma_running(void);
 --
 1.6.0.4
 
 --
 To unsubscribe from this list: send the line unsubscribe linux-omap in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH] OMAP: DMA: Add API for setting channel dest addr

2010-03-02 Thread G, Manjunath Kondaiah

Santosh,

 -Original Message-
 From: Shilimkar, Santosh 
 Sent: Tuesday, March 02, 2010 3:35 PM
 To: G, Manjunath Kondaiah; linux-omap@vger.kernel.org
 Cc: Tony Lindgren; S, Venkatraman; Raja, Govindraj
 Subject: RE: [PATCH] OMAP: DMA: Add API for setting channel dest addr
 
 Manju,
 Is this patch can build?
 

It looks like after generating patch, I did minor changes related to 
Description directly in the patch. While doing so, I goofed up lcd-lch. 

Thanks for figuring it out. 

-Manjunath

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html