Skip to content

Commit 3378e7a

Browse files
author
Vinod Koul
committed
Merge branch 'topic/qcom' into for-linus
2 parents dd2b9ff + dc7c733 commit 3378e7a

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

‎drivers/dma/qcom/hidma.c‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -865,6 +865,20 @@ static int hidma_probe(struct platform_device *pdev)
865865
return rc;
866866
}
867867

868+
static void hidma_shutdown(struct platform_device *pdev)
869+
{
870+
struct hidma_dev *dmadev = platform_get_drvdata(pdev);
871+
872+
dev_info(dmadev->ddev.dev, "HI-DMA engine shutdown\n");
873+
874+
pm_runtime_get_sync(dmadev->ddev.dev);
875+
if (hidma_ll_disable(dmadev->lldev))
876+
dev_warn(dmadev->ddev.dev, "channel did not stop\n");
877+
pm_runtime_mark_last_busy(dmadev->ddev.dev);
878+
pm_runtime_put_autosuspend(dmadev->ddev.dev);
879+
880+
}
881+
868882
static int hidma_remove(struct platform_device *pdev)
869883
{
870884
struct hidma_dev *dmadev = platform_get_drvdata(pdev);
@@ -908,6 +922,7 @@ MODULE_DEVICE_TABLE(of, hidma_match);
908922
static struct platform_driver hidma_driver = {
909923
.probe = hidma_probe,
910924
.remove = hidma_remove,
925+
.shutdown = hidma_shutdown,
911926
.driver = {
912927
.name = "hidma",
913928
.of_match_table = hidma_match,

‎drivers/dma/qcom/hidma_ll.c‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,9 @@ int hidma_ll_enable(struct hidma_lldev *lldev)
499499
lldev->trch_state = HIDMA_CH_ENABLED;
500500
lldev->evch_state = HIDMA_CH_ENABLED;
501501

502+
/* enable irqs */
503+
writel(ENABLE_IRQS, lldev->evca + HIDMA_EVCA_IRQ_EN_REG);
504+
502505
return 0;
503506
}
504507

@@ -596,6 +599,9 @@ int hidma_ll_disable(struct hidma_lldev *lldev)
596599

597600
lldev->trch_state = HIDMA_CH_SUSPENDED;
598601
lldev->evch_state = HIDMA_CH_SUSPENDED;
602+
603+
/* disable interrupts */
604+
writel(0, lldev->evca + HIDMA_EVCA_IRQ_EN_REG);
599605
return 0;
600606
}
601607

0 commit comments

Comments
 (0)