diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-10 16:37:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-10 16:37:36 -0400 |
commit | ec5b103ecfde929004b691f29183255aeeadecd5 (patch) | |
tree | 3b16d0654c074b5b36d06e56110c7218a8685655 /drivers/dma/dmaengine.c | |
parent | d0048f0b91ee35ab940ec6cbdfdd238c55b12a14 (diff) | |
parent | 5622ff1a4dd7dcb1c09953d8066a4e7c4c350b2d (diff) |
Merge branch 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma
Pull slave-dmaengine updates from Vinod Koul:
"This pull brings:
- Andy's DW driver updates
- Guennadi's sh driver updates
- Pl08x driver fixes from Tomasz & Alban
- Improvements to mmp_pdma by Daniel
- TI EDMA fixes by Joel
- New drivers:
- Hisilicon k3dma driver
- Renesas rcar dma driver
- New API for publishing slave driver capablities
- Various fixes across the subsystem by Andy, Jingoo, Sachin etc..."
* 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma: (94 commits)
dma: edma: Remove limits on number of slots
dma: edma: Leave linked to Null slot instead of DUMMY slot
dma: edma: Find missed events and issue them
ARM: edma: Add function to manually trigger an EDMA channel
dma: edma: Write out and handle MAX_NR_SG at a given time
dma: edma: Setup parameters to DMA MAX_NR_SG at a time
dmaengine: pl330: use dma_set_max_seg_size to set the sg limit
dmaengine: dma_slave_caps: remove sg entries
dma: replace devm_request_and_ioremap by devm_ioremap_resource
dma: ste_dma40: Fix potential null pointer dereference
dma: ste_dma40: Remove duplicate const
dma: imx-dma: Remove redundant NULL check
dma: dmagengine: fix function names in comments
dma: add driver for R-Car HPB-DMAC
dma: k3dma: use devm_ioremap_resource() instead of devm_request_and_ioremap()
dma: imx-sdma: Staticize sdma_driver_data structures
pch_dma: Add MODULE_DEVICE_TABLE
dmaengine: PL08x: Add cyclic transfer support
dmaengine: PL08x: Fix reading the byte count in cctl
dmaengine: PL08x: Add support for different maximum transfer size
...
Diffstat (limited to 'drivers/dma/dmaengine.c')
-rw-r--r-- | drivers/dma/dmaengine.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c index eee16b01fa89..9162ac80c18f 100644 --- a/drivers/dma/dmaengine.c +++ b/drivers/dma/dmaengine.c | |||
@@ -509,7 +509,33 @@ static struct dma_chan *private_candidate(const dma_cap_mask_t *mask, | |||
509 | } | 509 | } |
510 | 510 | ||
511 | /** | 511 | /** |
512 | * dma_request_channel - try to allocate an exclusive channel | 512 | * dma_request_slave_channel - try to get specific channel exclusively |
513 | * @chan: target channel | ||
514 | */ | ||
515 | struct dma_chan *dma_get_slave_channel(struct dma_chan *chan) | ||
516 | { | ||
517 | int err = -EBUSY; | ||
518 | |||
519 | /* lock against __dma_request_channel */ | ||
520 | mutex_lock(&dma_list_mutex); | ||
521 | |||
522 | if (chan->client_count == 0) { | ||
523 | err = dma_chan_get(chan); | ||
524 | if (err) | ||
525 | pr_debug("%s: failed to get %s: (%d)\n", | ||
526 | __func__, dma_chan_name(chan), err); | ||
527 | } else | ||
528 | chan = NULL; | ||
529 | |||
530 | mutex_unlock(&dma_list_mutex); | ||
531 | |||
532 | |||
533 | return chan; | ||
534 | } | ||
535 | EXPORT_SYMBOL_GPL(dma_get_slave_channel); | ||
536 | |||
537 | /** | ||
538 | * __dma_request_channel - try to allocate an exclusive channel | ||
513 | * @mask: capabilities that the channel must satisfy | 539 | * @mask: capabilities that the channel must satisfy |
514 | * @fn: optional callback to disposition available channels | 540 | * @fn: optional callback to disposition available channels |
515 | * @fn_param: opaque parameter to pass to dma_filter_fn | 541 | * @fn_param: opaque parameter to pass to dma_filter_fn |