summaryrefslogtreecommitdiff
path: root/drivers/dma/fsl-edma-v3.c
diff options
context:
space:
mode:
authorRobin Gong <yibin.gong@nxp.com>2017-07-04 14:45:25 +0800
committerLeonard Crestez <leonard.crestez@nxp.com>2018-08-24 12:41:33 +0300
commit4efcfe71a6a11f4283a63cd97a6d02d08b808cf6 (patch)
tree51eedc4d9b1fed98c7117d1e17baad1e22cc0c73 /drivers/dma/fsl-edma-v3.c
parentcefefe17476cb1e4068d76c95593015d6a860971 (diff)
MLK-15330-1: dma: fsl-edma-v3: combine two cells into one
For dual fifo case, fsl-edma-v3 need add another cell. It's not friendly for user and it's possible other cells maybe added to other use cases, so combine two cells into one now, and for some special use cases such as dual fifo property can directly be passed by one bit of cell3 rather than another cell. Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Diffstat (limited to 'drivers/dma/fsl-edma-v3.c')
-rw-r--r--drivers/dma/fsl-edma-v3.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/dma/fsl-edma-v3.c b/drivers/dma/fsl-edma-v3.c
index f78284958efd..20126a867dec 100644
--- a/drivers/dma/fsl-edma-v3.c
+++ b/drivers/dma/fsl-edma-v3.c
@@ -100,6 +100,9 @@
BIT(DMA_SLAVE_BUSWIDTH_8_BYTES) | \
BIT(DMA_SLAVE_BUSWIDTH_16_BYTES))
+#define ARGS_RX BIT(0)
+#define ARGS_REMOTE BIT(1)
+
struct fsl_edma3_hw_tcd {
__le32 saddr;
__le16 soff;
@@ -696,7 +699,7 @@ static struct dma_chan *fsl_edma3_xlate(struct of_phandle_args *dma_spec,
struct dma_chan *chan, *_chan;
struct fsl_edma3_chan *fsl_chan;
- if (dma_spec->args_count != 4)
+ if (dma_spec->args_count != 3)
return NULL;
mutex_lock(&fsl_edma3->fsl_edma3_mutex);
@@ -710,8 +713,8 @@ static struct dma_chan *fsl_edma3_xlate(struct of_phandle_args *dma_spec,
chan = dma_get_slave_channel(chan);
chan->device->privatecnt++;
fsl_chan->priority = dma_spec->args[1];
- fsl_chan->is_rxchan = dma_spec->args[2];
- fsl_chan->is_remote = dma_spec->args[3];
+ fsl_chan->is_rxchan = dma_spec->args[2] & ARGS_RX;
+ fsl_chan->is_remote = dma_spec->args[2] & ARGS_REMOTE;
mutex_unlock(&fsl_edma3->fsl_edma3_mutex);
return chan;
}