aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/kernel/bfin_dma_5xx.c
diff options
context:
space:
mode:
authorMichael Hennerich <michael.hennerich@analog.com>2008-07-19 04:57:32 -0400
committerBryan Wu <cooloney@kernel.org>2008-07-19 04:57:32 -0400
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)
472} 472}
473EXPORT_SYMBOL(get_dma_curr_addr); 473EXPORT_SYMBOL(get_dma_curr_addr);
474 474
475#ifdef CONFIG_PM
476int blackfin_dma_suspend(void)
477{
478 int i;
479
480 for (i = 0; i < MAX_BLACKFIN_DMA_CHANNEL; i++) {
481 if (dma_ch[i].chan_status == DMA_CHANNEL_ENABLED) {
482 printk(KERN_ERR "DMA Channel %d failed to suspend\n", i);
483 return -EBUSY;
484 }
485
486 dma_ch[i].saved_peripheral_map = dma_ch[i].regs->peripheral_map;
487 }
488
489 return 0;
490}
491
492void blackfin_dma_resume(void)
493{
494 int i;
495
496 for (i = 0; i < MAX_BLACKFIN_DMA_CHANNEL; i++)
497 dma_ch[i].regs->peripheral_map = dma_ch[i].saved_peripheral_map;
498}
499#endif
500
475static void *__dma_memcpy(void *dest, const void *src, size_t size) 501static void *__dma_memcpy(void *dest, const void *src, size_t size)
476{ 502{
477 int direction; /* 1 - address decrease, 0 - address increase */ 503 int direction; /* 1 - address decrease, 0 - address increase */