ARM: tegra: dma: Implement clock gating on suspend/resume
Laxman Dewangan [Tue, 6 Mar 2012 08:01:12 +0000 (13:01 +0530)]
Disabling clock of apb dma in suspend and enabling back on
resume.

Change-Id: I6320072ea25565bcab4833c9b10dcb6a9d526ac6
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/87991
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>

arch/arm/mach-tegra/dma.c

index 7873dc5..c5f32e6 100644 (file)
@@ -1066,6 +1066,8 @@ static int tegra_dma_suspend(void)
                *ctx++ = readl(addr + APB_DMA_CHAN_APB_SEQ);
        }
 
+       /* Disabling clock of dma. */
+       clk_disable(dma_clk);
        return 0;
 }
 
@@ -1074,6 +1076,9 @@ static void tegra_dma_resume(void)
        u32 *ctx = apb_dma;
        int i;
 
+       /* Enabling clock of dma. */
+       clk_enable(dma_clk);
+
        writel(*ctx++, general_dma_addr + APB_DMA_GEN);
        writel(*ctx++, general_dma_addr + APB_DMA_CNTRL);
        writel(*ctx++, general_dma_addr + APB_DMA_IRQ_MASK);