aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2014-10-28 18:30:58 -0400
committerVinod Koul <vinod.koul@intel.com>2015-01-18 09:25:57 -0500
commit0d5484b1c3db8a3870c6100deeb4678594433b2c (patch)
tree14209f1987ed0b61dd802c82508055a3fdf76004
parent816070ede77003e033c76cd1f72127d9bb6c9a03 (diff)
dmaengine: Move dma_get_slave_caps() implementation to dmaengine.c
The function is too big to be a static inline. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
-rw-r--r--drivers/dma/dmaengine.c33
-rw-r--r--include/linux/dmaengine.h32
2 files changed, 34 insertions, 31 deletions
diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c
index 30211f9791b7..f15712f2fec6 100644
--- a/drivers/dma/dmaengine.c
+++ b/drivers/dma/dmaengine.c
@@ -479,6 +479,39 @@ static void dma_channel_rebalance(void)
479 } 479 }
480} 480}
481 481
482int dma_get_slave_caps(struct dma_chan *chan, struct dma_slave_caps *caps)
483{
484 struct dma_device *device;
485
486 if (!chan || !caps)
487 return -EINVAL;
488
489 device = chan->device;
490
491 /* check if the channel supports slave transactions */
492 if (!test_bit(DMA_SLAVE, device->cap_mask.bits))
493 return -ENXIO;
494
495 /*
496 * Check whether it reports it uses the generic slave
497 * capabilities, if not, that means it doesn't support any
498 * kind of slave capabilities reporting.
499 */
500 if (!device->directions)
501 return -ENXIO;
502
503 caps->src_addr_widths = device->src_addr_widths;
504 caps->dst_addr_widths = device->dst_addr_widths;
505 caps->directions = device->directions;
506 caps->residue_granularity = device->residue_granularity;
507
508 caps->cmd_pause = !!device->device_pause;
509 caps->cmd_terminate = !!device->device_terminate_all;
510
511 return 0;
512}
513EXPORT_SYMBOL_GPL(dma_get_slave_caps);
514
482static struct dma_chan *private_candidate(const dma_cap_mask_t *mask, 515static struct dma_chan *private_candidate(const dma_cap_mask_t *mask,
483 struct dma_device *dev, 516 struct dma_device *dev,
484 dma_filter_fn fn, void *fn_param) 517 dma_filter_fn fn, void *fn_param)
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index 6d34ce91036c..1b4842bb3890 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -758,37 +758,7 @@ static inline struct dma_async_tx_descriptor *dmaengine_prep_dma_sg(
758 src_sg, src_nents, flags); 758 src_sg, src_nents, flags);
759} 759}
760 760
761static inline int dma_get_slave_caps(struct dma_chan *chan, struct dma_slave_caps *caps) 761int dma_get_slave_caps(struct dma_chan *chan, struct dma_slave_caps *caps);
762{
763 struct dma_device *device;
764
765 if (!chan || !caps)
766 return -EINVAL;
767
768 device = chan->device;
769
770 /* check if the channel supports slave transactions */
771 if (!test_bit(DMA_SLAVE, device->cap_mask.bits))
772 return -ENXIO;
773
774 /*
775 * Check whether it reports it uses the generic slave
776 * capabilities, if not, that means it doesn't support any
777 * kind of slave capabilities reporting.
778 */
779 if (!device->directions)
780 return -ENXIO;
781
782 caps->src_addr_widths = device->src_addr_widths;
783 caps->dst_addr_widths = device->dst_addr_widths;
784 caps->directions = device->directions;
785 caps->residue_granularity = device->residue_granularity;
786
787 caps->cmd_pause = !!device->device_pause;
788 caps->cmd_terminate = !!device->device_terminate_all;
789
790 return 0;
791}
792 762
793static inline int dmaengine_terminate_all(struct dma_chan *chan) 763static inline int dmaengine_terminate_all(struct dma_chan *chan)
794{ 764{