aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/kernel/bfin_dma_5xx.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/blackfin/kernel/bfin_dma_5xx.c')
-rw-r--r--arch/blackfin/kernel/bfin_dma_5xx.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/arch/blackfin/kernel/bfin_dma_5xx.c b/arch/blackfin/kernel/bfin_dma_5xx.c
index d54f19085f37..93229b3d6e3e 100644
--- a/arch/blackfin/kernel/bfin_dma_5xx.c
+++ b/arch/blackfin/kernel/bfin_dma_5xx.c
@@ -472,6 +472,40 @@ 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#ifdef CONFIG_BF561 /* IMDMA channels doesn't have a PERIPHERAL_MAP */
481 for (i = 0; i <= CH_MEM_STREAM3_SRC; i++) {
482#else
483 for (i = 0; i < MAX_BLACKFIN_DMA_CHANNEL; i++) {
484#endif
485 if (dma_ch[i].chan_status == DMA_CHANNEL_ENABLED) {
486 printk(KERN_ERR "DMA Channel %d failed to suspend\n", i);
487 return -EBUSY;
488 }
489
490 dma_ch[i].saved_peripheral_map = dma_ch[i].regs->peripheral_map;
491 }
492
493 return 0;
494}
495
496void blackfin_dma_resume(void)
497{
498 int i;
499
500#ifdef CONFIG_BF561 /* IMDMA channels doesn't have a PERIPHERAL_MAP */
501 for (i = 0; i <= CH_MEM_STREAM3_SRC; i++)
502#else
503 for (i = 0; i < MAX_BLACKFIN_DMA_CHANNEL; i++)
504#endif
505 dma_ch[i].regs->peripheral_map = dma_ch[i].saved_peripheral_map;
506}
507#endif
508
475static void *__dma_memcpy(void *dest, const void *src, size_t size) 509static void *__dma_memcpy(void *dest, const void *src, size_t size)
476{ 510{
477 int direction; /* 1 - address decrease, 0 - address increase */ 511 int direction; /* 1 - address decrease, 0 - address increase */