public inbox for linux-sh@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC][PATCH 4/6 v2] dmaengine: shdma: add .needs_tend_set / .no_dmars
@ 2011-06-17  5:28 Kuninori Morimoto
  2011-06-17  5:34 ` [RFC][PATCH 4/6 v2] dmaengine: shdma: add .needs_tend_set / Simon Horman
  0 siblings, 1 reply; 2+ messages in thread
From: Kuninori Morimoto @ 2011-06-17  5:28 UTC (permalink / raw)
  To: linux-sh

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
This is v2 of "dmaengine: shdma: add is_usbdmac flag"

v1 -> v2

 - use "needs_tend_set" / "no_dmars" instead of "is_usbdmac",

 drivers/dma/shdma.c    |    6 ++++++
 include/linux/sh_dma.h |    4 ++++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/drivers/dma/shdma.c b/drivers/dma/shdma.c
index aa91309..d903bdc 100644
--- a/drivers/dma/shdma.c
+++ b/drivers/dma/shdma.c
@@ -194,6 +194,9 @@ static void dmae_start(struct sh_dmae_chan *sh_chan)
 	struct sh_dmae_device *shdev = to_sh_dev(sh_chan);
 	u32 chcr = chcr_read(sh_chan);
 
+	if (shdev->pdata->needs_tend_set)
+		sh_dmae_writel(sh_chan, 0xFFFFFFFF, TEND);
+
 	chcr |= CHCR_DE | shdev->chcr_ie_bit;
 	chcr_write(sh_chan, chcr & ~CHCR_TE);
 }
@@ -242,6 +245,9 @@ static int dmae_set_dmars(struct sh_dmae_chan *sh_chan, u16 val)
 	if (dmae_is_busy(sh_chan))
 		return -EBUSY;
 
+	if (pdata->no_dmars)
+		return 0;
+
 	/* in the case of a missing DMARS resource use first memory window */
 	if (!addr)
 		addr = (u16 __iomem *)shdev->chan_reg;
diff --git a/include/linux/sh_dma.h b/include/linux/sh_dma.h
index 6a98daf..3b9ffb9 100644
--- a/include/linux/sh_dma.h
+++ b/include/linux/sh_dma.h
@@ -66,6 +66,8 @@ struct sh_dmae_pdata {
 	u32 chcr_ie_bit;
 
 	u32 dmaor_is_32bit:1;
+	u32 needs_tend_set:1;
+	u32 no_dmars:1;
 };
 
 /* DMA register */
@@ -75,6 +77,8 @@ struct sh_dmae_pdata {
 #define CHCR	0x0C
 #define DMAOR	0x40
 
+#define TEND	0x18 /* USB-DMAC */
+
 /* DMAOR definitions */
 #define DMAOR_AE	0x00000004
 #define DMAOR_NMIF	0x00000002
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [RFC][PATCH 4/6 v2] dmaengine: shdma: add .needs_tend_set /
  2011-06-17  5:28 [RFC][PATCH 4/6 v2] dmaengine: shdma: add .needs_tend_set / .no_dmars Kuninori Morimoto
@ 2011-06-17  5:34 ` Simon Horman
  0 siblings, 0 replies; 2+ messages in thread
From: Simon Horman @ 2011-06-17  5:34 UTC (permalink / raw)
  To: linux-sh

On Fri, Jun 17, 2011 at 02:28:35PM +0900, Kuninori Morimoto wrote:
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Reviewed-by: Simon Horman <horms@verge.net.au>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-06-17  5:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-17  5:28 [RFC][PATCH 4/6 v2] dmaengine: shdma: add .needs_tend_set / .no_dmars Kuninori Morimoto
2011-06-17  5:34 ` [RFC][PATCH 4/6 v2] dmaengine: shdma: add .needs_tend_set / Simon Horman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox