DMAENGINE: generic channel status v2
Convert the device_is_tx_complete() operation on the DMA engine to a generic device_tx_status()operation which can return three states, DMA_TX_RUNNING, DMA_TX_COMPLETE, DMA_TX_PAUSED. [dan.j.williams@intel.com: update for timberdale] Signed-off-by: Linus Walleij <linus.walleij@stericsson.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: Maciej Sosnowski <maciej.sosnowski@intel.com> Cc: Nicolas Ferre <nicolas.ferre@atmel.com> Cc: Pavel Machek <pavel@ucw.cz> Cc: Li Yang <leoli@freescale.com> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Cc: Paul Mundt <lethal@linux-sh.org> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Haavard Skinnemoen <haavard.skinnemoen@atmel.com> Cc: Magnus Damm <damm@opensource.se> Cc: Liam Girdwood <lrg@slimlogic.co.uk> Cc: Joe Perches <joe@perches.com> Cc: Roland Dreier <rdreier@cisco.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
This commit is contained in:
committed by
Dan Williams
parent
c3635c78e5
commit
0793448187
@ -819,9 +819,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 +841,11 @@ 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;
|
||||
if (txstate) {
|
||||
txstate->last = last_complete;
|
||||
txstate->used = last_used;
|
||||
txstate->residue = 0;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
@ -1346,7 +1347,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);
|
||||
|
Reference in New Issue
Block a user