dmaengine: qcom_hidma: disable/enable IRQs on pause/resume
authorSinan Kaya <okaya@codeaurora.org>
Sat, 25 Mar 2017 23:04:02 +0000 (19:04 -0400)
committerVinod Koul <vinod.koul@intel.com>
Mon, 27 Mar 2017 05:13:38 +0000 (10:43 +0530)
Once the channels are stopped, disable interrupts to make sure no new
HW interaction can happen.

Similarly, re-enable the interrupts only if we know that channel is
operational again.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/qcom/hidma_ll.c

index 6645bdf0d151eafe4fa21c2fc1656554653a9920..1530a661518d7f2d41b7fe029377384b09e71271 100644 (file)
@@ -499,6 +499,9 @@ int hidma_ll_enable(struct hidma_lldev *lldev)
        lldev->trch_state = HIDMA_CH_ENABLED;
        lldev->evch_state = HIDMA_CH_ENABLED;
 
+       /* enable irqs */
+       writel(ENABLE_IRQS, lldev->evca + HIDMA_EVCA_IRQ_EN_REG);
+
        return 0;
 }
 
@@ -596,6 +599,9 @@ int hidma_ll_disable(struct hidma_lldev *lldev)
 
        lldev->trch_state = HIDMA_CH_SUSPENDED;
        lldev->evch_state = HIDMA_CH_SUSPENDED;
+
+       /* disable interrupts */
+       writel(0, lldev->evca + HIDMA_EVCA_IRQ_EN_REG);
        return 0;
 }