dmaengine: shdma: Common SH_DMA_SLAVE_NUMBER
authorMagnus Damm <damm@opensource.se>
Fri, 19 Mar 2010 04:46:47 +0000 (04:46 +0000)
committerPaul Mundt <lethal@linux-sh.org>
Tue, 23 Mar 2010 08:19:39 +0000 (17:19 +0900)
Move SHDMA_SLAVE_NUMBER from asm/dmaengine.h to
shdma.h. Set it to 256 to support a wide range
of processors. The amount of memory consumed by
this change is limited to 256 bits.

While at it, rename to SH_DMA_SLAVE_NUMBER to
match with the rest of the file.

Signed-off-by: Magnus Damm <damm@opensource.se>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
arch/sh/include/asm/dmaengine.h
drivers/dma/shdma.c
drivers/dma/shdma.h

index 568e991442b0ee969f8fd11506b3ed0ee481c69e..abb8d660b6fb9434d659a81fe8801447efcdca9f 100644 (file)
@@ -34,7 +34,6 @@ enum {
        SHDMA_SLAVE_SIUA_RX,
        SHDMA_SLAVE_SIUB_TX,
        SHDMA_SLAVE_SIUB_RX,
-       SHDMA_SLAVE_NUMBER,     /* Must stay last */
 };
 
 struct sh_dmae_slave_config {
index e5588f4868ca0ac7ce68d9066b03e87d40d82a99..83605389fb5637bbf916b153522485c88cff11d6 100644 (file)
@@ -44,7 +44,7 @@ enum sh_dmae_desc_status {
 #define LOG2_DEFAULT_XFER_SIZE 2
 
 /* A bitmask with bits enough for enum sh_dmae_slave_chan_id */
-static unsigned long sh_dmae_slave_used[BITS_TO_LONGS(SHDMA_SLAVE_NUMBER)];
+static unsigned long sh_dmae_slave_used[BITS_TO_LONGS(SH_DMA_SLAVE_NUMBER)];
 
 static void sh_dmae_chan_ld_cleanup(struct sh_dmae_chan *sh_chan, bool all);
 
@@ -274,7 +274,7 @@ static struct sh_dmae_slave_config *sh_dmae_find_slave(
        struct sh_dmae_pdata *pdata = shdev->pdata;
        int i;
 
-       if (param->slave_id >= SHDMA_SLAVE_NUMBER)
+       if (param->slave_id >= SH_DMA_SLAVE_NUMBER)
                return NULL;
 
        for (i = 0; i < pdata->slave_num; i++)
index 153609a1e96c55092f2eb99911552eee7b08e802..d7ddf6f4715421fd54bba53c4f0f6ad829259272 100644 (file)
@@ -19,6 +19,7 @@
 
 #include <asm/dmaengine.h>
 
+#define SH_DMA_SLAVE_NUMBER 256
 #define SH_DMA_TCR_MAX 0x00FFFFFF      /* 16MB */
 
 struct device;