summaryrefslogtreecommitdiff
path: root/arch/blackfin/kernel/bfin_dma_5xx.c
diff options
context:
space:
mode:
authorMichael Hennerich <michael.hennerich@analog.com>2008-07-19 16:57:32 +0800
committerBryan Wu <cooloney@kernel.org>2008-07-19 16:57:32 +0800
commit1efc80b53eb54770139219f99657abd92595fc86 (patch)
tree254c76b3aaf22110b116e67a8118945006cacce6 /arch/blackfin/kernel/bfin_dma_5xx.c
parent4f13f548cef5af1717cbbc341a1a3474f3e7466e (diff)
Blackfin arch: Functional power management support
Enable: PM_SUSPEND_MEM -> Blackfin Hibernate to SDRAM This feature requires a special bootloader (u-boot) supporting return from hibernate. Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
Diffstat (limited to 'arch/blackfin/kernel/bfin_dma_5xx.c')
-rw-r--r--arch/blackfin/kernel/bfin_dma_5xx.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/arch/blackfin/kernel/bfin_dma_5xx.c b/arch/blackfin/kernel/bfin_dma_5xx.c
index d54f19085f37..ad0e75845ac2 100644
--- a/arch/blackfin/kernel/bfin_dma_5xx.c
+++ b/arch/blackfin/kernel/bfin_dma_5xx.c
@@ -472,6 +472,32 @@ unsigned long get_dma_curr_addr(unsigned int channel)
}
EXPORT_SYMBOL(get_dma_curr_addr);
+#ifdef CONFIG_PM
+int blackfin_dma_suspend(void)
+{
+ int i;
+
+ for (i = 0; i < MAX_BLACKFIN_DMA_CHANNEL; i++) {
+ if (dma_ch[i].chan_status == DMA_CHANNEL_ENABLED) {
+ printk(KERN_ERR "DMA Channel %d failed to suspend\n", i);
+ return -EBUSY;
+ }
+
+ dma_ch[i].saved_peripheral_map = dma_ch[i].regs->peripheral_map;
+ }
+
+ return 0;
+}
+
+void blackfin_dma_resume(void)
+{
+ int i;
+
+ for (i = 0; i < MAX_BLACKFIN_DMA_CHANNEL; i++)
+ dma_ch[i].regs->peripheral_map = dma_ch[i].saved_peripheral_map;
+}
+#endif
+
static void *__dma_memcpy(void *dest, const void *src, size_t size)
{
int direction; /* 1 - address decrease, 0 - address increase */