aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/dmaengine.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/dma/dmaengine.c')
-rw-r--r--drivers/dma/dmaengine.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c
index 0e035a8cf401..3ddfd1f6c23c 100644
--- a/drivers/dma/dmaengine.c
+++ b/drivers/dma/dmaengine.c
@@ -487,7 +487,11 @@ int dma_get_slave_caps(struct dma_chan *chan, struct dma_slave_caps *caps)
487 caps->directions = device->directions; 487 caps->directions = device->directions;
488 caps->residue_granularity = device->residue_granularity; 488 caps->residue_granularity = device->residue_granularity;
489 489
490 caps->cmd_pause = !!device->device_pause; 490 /*
491 * Some devices implement only pause (e.g. to get residuum) but no
492 * resume. However cmd_pause is advertised as pause AND resume.
493 */
494 caps->cmd_pause = !!(device->device_pause && device->device_resume);
491 caps->cmd_terminate = !!device->device_terminate_all; 495 caps->cmd_terminate = !!device->device_terminate_all;
492 496
493 return 0; 497 return 0;
@@ -571,11 +575,15 @@ struct dma_chan *dma_get_any_slave_channel(struct dma_device *device)
571 575
572 chan = private_candidate(&mask, device, NULL, NULL); 576 chan = private_candidate(&mask, device, NULL, NULL);
573 if (chan) { 577 if (chan) {
578 dma_cap_set(DMA_PRIVATE, device->cap_mask);
579 device->privatecnt++;
574 err = dma_chan_get(chan); 580 err = dma_chan_get(chan);
575 if (err) { 581 if (err) {
576 pr_debug("%s: failed to get %s: (%d)\n", 582 pr_debug("%s: failed to get %s: (%d)\n",
577 __func__, dma_chan_name(chan), err); 583 __func__, dma_chan_name(chan), err);
578 chan = NULL; 584 chan = NULL;
585 if (--device->privatecnt == 0)
586 dma_cap_clear(DMA_PRIVATE, device->cap_mask);
579 } 587 }
580 } 588 }
581 589