]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/dma/dw_dmac.c
DMAENGINE: extend the control command to include an arg
[net-next-2.6.git] / drivers / dma / dw_dmac.c
index 8a6b85f61176dd457a9ff549ef1c1be71b2a88af..a3991ab0d67e06cf6e99d41d9a1a923109dc1a06 100644 (file)
@@ -781,7 +781,8 @@ err_desc_get:
        return NULL;
 }
 
-static int dwc_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd)
+static int dwc_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
+                      unsigned long arg)
 {
        struct dw_dma_chan      *dwc = to_dw_dma_chan(chan);
        struct dw_dma           *dw = to_dw_dma(chan->device);
@@ -819,9 +820,9 @@ static int dwc_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd)
 }
 
 static enum dma_status
-dwc_is_tx_complete(struct dma_chan *chan,
-               dma_cookie_t cookie,
-               dma_cookie_t *done, dma_cookie_t *used)
+dwc_tx_status(struct dma_chan *chan,
+             dma_cookie_t cookie,
+             struct dma_tx_state *txstate)
 {
        struct dw_dma_chan      *dwc = to_dw_dma_chan(chan);
        dma_cookie_t            last_used;
@@ -841,10 +842,7 @@ dwc_is_tx_complete(struct dma_chan *chan,
                ret = dma_async_is_complete(cookie, last_complete, last_used);
        }
 
-       if (done)
-               *done = last_complete;
-       if (used)
-               *used = last_used;
+       dma_set_tx_state(txstate, last_complete, last_used, 0);
 
        return ret;
 }
@@ -1346,7 +1344,7 @@ static int __init dw_probe(struct platform_device *pdev)
        dw->dma.device_prep_slave_sg = dwc_prep_slave_sg;
        dw->dma.device_control = dwc_control;
 
-       dw->dma.device_is_tx_complete = dwc_is_tx_complete;
+       dw->dma.device_tx_status = dwc_tx_status;
        dw->dma.device_issue_pending = dwc_issue_pending;
 
        dma_writel(dw, CFG, DW_CFG_DMA_EN);