aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/ipu
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@stericsson.com>2010-05-17 19:30:42 -0400
committerDan Williams <dan.j.williams@intel.com>2010-05-17 19:30:42 -0400
commit058276303dbc4ed089c1f7dad0871810b1f5ddf1 (patch)
treedf26ff701721b2a91d61bd29e48bad7cbcedd746 /drivers/dma/ipu
parent4aed79b2818e7330b5d00143e4c20bc6555df91f (diff)
DMAENGINE: extend the control command to include an arg
This adds an argument to the DMAengine control function, so that we can later provide control commands that need some external data passed in through an argument akin to the ioctl() operation prototype. [dan.j.williams@intel.com: fix up some missed conversions] Signed-off-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/dma/ipu')
-rw-r--r--drivers/dma/ipu/ipu_idmac.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/dma/ipu/ipu_idmac.c b/drivers/dma/ipu/ipu_idmac.c
index 246a6143e4a7..cb26ee9773d6 100644
--- a/drivers/dma/ipu/ipu_idmac.c
+++ b/drivers/dma/ipu/ipu_idmac.c
@@ -1472,7 +1472,8 @@ static void idmac_issue_pending(struct dma_chan *chan)
1472 */ 1472 */
1473} 1473}
1474 1474
1475static int __idmac_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd) 1475static int __idmac_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
1476 unsigned long arg)
1476{ 1477{
1477 struct idmac_channel *ichan = to_idmac_chan(chan); 1478 struct idmac_channel *ichan = to_idmac_chan(chan);
1478 struct idmac *idmac = to_idmac(chan->device); 1479 struct idmac *idmac = to_idmac(chan->device);
@@ -1513,14 +1514,15 @@ static int __idmac_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd)
1513 return 0; 1514 return 0;
1514} 1515}
1515 1516
1516static int idmac_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd) 1517static int idmac_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
1518 unsigned long arg)
1517{ 1519{
1518 struct idmac_channel *ichan = to_idmac_chan(chan); 1520 struct idmac_channel *ichan = to_idmac_chan(chan);
1519 int ret; 1521 int ret;
1520 1522
1521 mutex_lock(&ichan->chan_mutex); 1523 mutex_lock(&ichan->chan_mutex);
1522 1524
1523 ret = __idmac_control(chan, cmd); 1525 ret = __idmac_control(chan, cmd, arg);
1524 1526
1525 mutex_unlock(&ichan->chan_mutex); 1527 mutex_unlock(&ichan->chan_mutex);
1526 1528
@@ -1616,7 +1618,7 @@ static void idmac_free_chan_resources(struct dma_chan *chan)
1616 1618
1617 mutex_lock(&ichan->chan_mutex); 1619 mutex_lock(&ichan->chan_mutex);
1618 1620
1619 __idmac_control(chan, DMA_TERMINATE_ALL); 1621 __idmac_control(chan, DMA_TERMINATE_ALL, 0);
1620 1622
1621 if (ichan->status > IPU_CHANNEL_FREE) { 1623 if (ichan->status > IPU_CHANNEL_FREE) {
1622#ifdef DEBUG 1624#ifdef DEBUG
@@ -1709,7 +1711,7 @@ static void __exit ipu_idmac_exit(struct ipu *ipu)
1709 for (i = 0; i < IPU_CHANNELS_NUM; i++) { 1711 for (i = 0; i < IPU_CHANNELS_NUM; i++) {
1710 struct idmac_channel *ichan = ipu->channel + i; 1712 struct idmac_channel *ichan = ipu->channel + i;
1711 1713
1712 idmac_control(&ichan->dma_chan, DMA_TERMINATE_ALL); 1714 idmac_control(&ichan->dma_chan, DMA_TERMINATE_ALL, 0);
1713 idmac_prep_slave_sg(&ichan->dma_chan, NULL, 0, DMA_NONE, 0); 1715 idmac_prep_slave_sg(&ichan->dma_chan, NULL, 0, DMA_NONE, 0);
1714 } 1716 }
1715 1717