dmaengine: shdma: Remove sh_dmae_slave_chan_id enum
authorMagnus Damm <damm@opensource.se>
Fri, 19 Mar 2010 04:46:38 +0000 (04:46 +0000)
committerPaul Mundt <lethal@linux-sh.org>
Tue, 23 Mar 2010 08:19:30 +0000 (17:19 +0900)
This patch replaces the sh_dmae_slave_chan_id enum
with an unsigned int. The purpose of this chainge is
to make it possible to separate the slave id enums
from the dmaengine header.

The slave id enums varies with processor model, so in
the future it makes sense to put these in the processor
specific headers together with the pinmux enums.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
arch/sh/include/asm/dmaengine.h
arch/sh/include/asm/siu.h
drivers/dma/shdma.c
drivers/serial/sh-sci.c
include/linux/serial_sci.h

index bf2f30cf0a2773c391ba4314ddc925fb8ea39bb8..568e991442b0ee969f8fd11506b3ed0ee481c69e 100644 (file)
@@ -17,7 +17,7 @@
 
 #define SH_DMAC_MAX_CHANNELS   6
 
-enum sh_dmae_slave_chan_id {
+enum {
        SHDMA_SLAVE_SCIF0_TX,
        SHDMA_SLAVE_SCIF0_RX,
        SHDMA_SLAVE_SCIF1_TX,
@@ -38,7 +38,7 @@ enum sh_dmae_slave_chan_id {
 };
 
 struct sh_dmae_slave_config {
-       enum sh_dmae_slave_chan_id      slave_id;
+       unsigned int                    slave_id;
        dma_addr_t                      addr;
        u32                             chcr;
        char                            mid_rid;
@@ -68,7 +68,7 @@ struct device;
 
 /* Used by slave DMA clients to request DMA to/from a specific peripheral */
 struct sh_dmae_slave {
-       enum sh_dmae_slave_chan_id      slave_id; /* Set by the platform */
+       unsigned int                    slave_id; /* Set by the platform */
        struct device                   *dma_dev; /* Set by the platform */
        struct sh_dmae_slave_config     *config;  /* Set by the driver */
 };
index f1b1e6944a5ff3cfb13681226da767f9f0baadb9..e8d4142baf59f9377ca55ab3ad85ef42039b3003 100644 (file)
@@ -17,10 +17,10 @@ struct device;
 
 struct siu_platform {
        struct device *dma_dev;
-       enum sh_dmae_slave_chan_id dma_slave_tx_a;
-       enum sh_dmae_slave_chan_id dma_slave_rx_a;
-       enum sh_dmae_slave_chan_id dma_slave_tx_b;
-       enum sh_dmae_slave_chan_id dma_slave_rx_b;
+       unsigned int dma_slave_tx_a;
+       unsigned int dma_slave_rx_a;
+       unsigned int dma_slave_tx_b;
+       unsigned int dma_slave_rx_b;
 };
 
 #endif /* ASM_SIU_H */
index 5d17e09cb625412beaf0e8275f39142b7006a4c1..e5588f4868ca0ac7ce68d9066b03e87d40d82a99 100644 (file)
@@ -266,7 +266,7 @@ static struct sh_desc *sh_dmae_get_desc(struct sh_dmae_chan *sh_chan)
 }
 
 static struct sh_dmae_slave_config *sh_dmae_find_slave(
-       struct sh_dmae_chan *sh_chan, enum sh_dmae_slave_chan_id slave_id)
+       struct sh_dmae_chan *sh_chan, struct sh_dmae_slave *param)
 {
        struct dma_device *dma_dev = sh_chan->common.device;
        struct sh_dmae_device *shdev = container_of(dma_dev,
@@ -274,11 +274,11 @@ static struct sh_dmae_slave_config *sh_dmae_find_slave(
        struct sh_dmae_pdata *pdata = shdev->pdata;
        int i;
 
-       if ((unsigned)slave_id >= SHDMA_SLAVE_NUMBER)
+       if (param->slave_id >= SHDMA_SLAVE_NUMBER)
                return NULL;
 
        for (i = 0; i < pdata->slave_num; i++)
-               if (pdata->slave[i].slave_id == slave_id)
+               if (pdata->slave[i].slave_id == param->slave_id)
                        return pdata->slave + i;
 
        return NULL;
@@ -299,7 +299,7 @@ static int sh_dmae_alloc_chan_resources(struct dma_chan *chan)
        if (param) {
                struct sh_dmae_slave_config *cfg;
 
-               cfg = sh_dmae_find_slave(sh_chan, param->slave_id);
+               cfg = sh_dmae_find_slave(sh_chan, param);
                if (!cfg)
                        return -EINVAL;
 
index f7b9aff88f4a28836ef502b59ff37e77c32faf08..2d9a06db83b566de81895f44b930549c4acd1631 100644 (file)
@@ -90,8 +90,8 @@ struct sci_port {
        struct dma_chan                 *chan_rx;
 #ifdef CONFIG_SERIAL_SH_SCI_DMA
        struct device                   *dma_dev;
-       enum sh_dmae_slave_chan_id      slave_tx;
-       enum sh_dmae_slave_chan_id      slave_rx;
+       unsigned int                    slave_tx;
+       unsigned int                    slave_rx;
        struct dma_async_tx_descriptor  *desc_tx;
        struct dma_async_tx_descriptor  *desc_rx[2];
        dma_cookie_t                    cookie_tx;
index 193d4bfe42ffd5ae030bb4357a64de0da00a0ebc..f5364a1de68b105dac76e0125e93e767c21c2836 100644 (file)
@@ -33,8 +33,8 @@ struct plat_sci_port {
        char            *clk;                   /* clock string */
        struct device   *dma_dev;
 #ifdef CONFIG_SERIAL_SH_SCI_DMA
-       enum sh_dmae_slave_chan_id dma_slave_tx;
-       enum sh_dmae_slave_chan_id dma_slave_rx;
+       unsigned int dma_slave_tx;
+       unsigned int dma_slave_rx;
 #endif
 };