diff options
Diffstat (limited to 'drivers/dma/qcom/hidma.c')
-rw-r--r-- | drivers/dma/qcom/hidma.c | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/drivers/dma/qcom/hidma.c b/drivers/dma/qcom/hidma.c index 34fb6afd229b..e3669850aef4 100644 --- a/drivers/dma/qcom/hidma.c +++ b/drivers/dma/qcom/hidma.c | |||
@@ -411,7 +411,40 @@ hidma_prep_dma_memcpy(struct dma_chan *dmach, dma_addr_t dest, dma_addr_t src, | |||
411 | return NULL; | 411 | return NULL; |
412 | 412 | ||
413 | hidma_ll_set_transfer_params(mdma->lldev, mdesc->tre_ch, | 413 | hidma_ll_set_transfer_params(mdma->lldev, mdesc->tre_ch, |
414 | src, dest, len, flags); | 414 | src, dest, len, flags, |
415 | HIDMA_TRE_MEMCPY); | ||
416 | |||
417 | /* Place descriptor in prepared list */ | ||
418 | spin_lock_irqsave(&mchan->lock, irqflags); | ||
419 | list_add_tail(&mdesc->node, &mchan->prepared); | ||
420 | spin_unlock_irqrestore(&mchan->lock, irqflags); | ||
421 | |||
422 | return &mdesc->desc; | ||
423 | } | ||
424 | |||
425 | static struct dma_async_tx_descriptor * | ||
426 | hidma_prep_dma_memset(struct dma_chan *dmach, dma_addr_t dest, int value, | ||
427 | size_t len, unsigned long flags) | ||
428 | { | ||
429 | struct hidma_chan *mchan = to_hidma_chan(dmach); | ||
430 | struct hidma_desc *mdesc = NULL; | ||
431 | struct hidma_dev *mdma = mchan->dmadev; | ||
432 | unsigned long irqflags; | ||
433 | |||
434 | /* Get free descriptor */ | ||
435 | spin_lock_irqsave(&mchan->lock, irqflags); | ||
436 | if (!list_empty(&mchan->free)) { | ||
437 | mdesc = list_first_entry(&mchan->free, struct hidma_desc, node); | ||
438 | list_del(&mdesc->node); | ||
439 | } | ||
440 | spin_unlock_irqrestore(&mchan->lock, irqflags); | ||
441 | |||
442 | if (!mdesc) | ||
443 | return NULL; | ||
444 | |||
445 | hidma_ll_set_transfer_params(mdma->lldev, mdesc->tre_ch, | ||
446 | value, dest, len, flags, | ||
447 | HIDMA_TRE_MEMSET); | ||
415 | 448 | ||
416 | /* Place descriptor in prepared list */ | 449 | /* Place descriptor in prepared list */ |
417 | spin_lock_irqsave(&mchan->lock, irqflags); | 450 | spin_lock_irqsave(&mchan->lock, irqflags); |
@@ -776,6 +809,7 @@ static int hidma_probe(struct platform_device *pdev) | |||
776 | pm_runtime_get_sync(dmadev->ddev.dev); | 809 | pm_runtime_get_sync(dmadev->ddev.dev); |
777 | 810 | ||
778 | dma_cap_set(DMA_MEMCPY, dmadev->ddev.cap_mask); | 811 | dma_cap_set(DMA_MEMCPY, dmadev->ddev.cap_mask); |
812 | dma_cap_set(DMA_MEMSET, dmadev->ddev.cap_mask); | ||
779 | if (WARN_ON(!pdev->dev.dma_mask)) { | 813 | if (WARN_ON(!pdev->dev.dma_mask)) { |
780 | rc = -ENXIO; | 814 | rc = -ENXIO; |
781 | goto dmafree; | 815 | goto dmafree; |
@@ -786,6 +820,7 @@ static int hidma_probe(struct platform_device *pdev) | |||
786 | dmadev->dev_trca = trca; | 820 | dmadev->dev_trca = trca; |
787 | dmadev->trca_resource = trca_resource; | 821 | dmadev->trca_resource = trca_resource; |
788 | dmadev->ddev.device_prep_dma_memcpy = hidma_prep_dma_memcpy; | 822 | dmadev->ddev.device_prep_dma_memcpy = hidma_prep_dma_memcpy; |
823 | dmadev->ddev.device_prep_dma_memset = hidma_prep_dma_memset; | ||
789 | dmadev->ddev.device_alloc_chan_resources = hidma_alloc_chan_resources; | 824 | dmadev->ddev.device_alloc_chan_resources = hidma_alloc_chan_resources; |
790 | dmadev->ddev.device_free_chan_resources = hidma_free_chan_resources; | 825 | dmadev->ddev.device_free_chan_resources = hidma_free_chan_resources; |
791 | dmadev->ddev.device_tx_status = hidma_tx_status; | 826 | dmadev->ddev.device_tx_status = hidma_tx_status; |