Blackfin arch: push bf561 PERIPHERAL_MAP oddity into bf561-specific code

Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
This commit is contained in:
Mike Frysinger 2009-01-07 23:14:39 +08:00 committed by Bryan Wu
parent 51ed9ad7d2
commit c9e0020d49
2 changed files with 8 additions and 11 deletions

View File

@ -411,15 +411,14 @@ unsigned long get_dma_curr_addr(unsigned int channel)
EXPORT_SYMBOL(get_dma_curr_addr); EXPORT_SYMBOL(get_dma_curr_addr);
#ifdef CONFIG_PM #ifdef CONFIG_PM
# ifndef MAX_DMA_SUSPEND_CHANNELS
# define MAX_DMA_SUSPEND_CHANNELS MAX_DMA_CHANNELS
# endif
int blackfin_dma_suspend(void) int blackfin_dma_suspend(void)
{ {
int i; int i;
#ifdef CONFIG_BF561 /* IMDMA channels doesn't have a PERIPHERAL_MAP */ for (i = 0; i < MAX_DMA_SUSPEND_CHANNELS; ++i) {
for (i = 0; i <= CH_MEM_STREAM3_SRC; i++) {
#else
for (i = 0; i < MAX_DMA_CHANNELS; i++) {
#endif
if (dma_ch[i].chan_status == DMA_CHANNEL_ENABLED) { if (dma_ch[i].chan_status == DMA_CHANNEL_ENABLED) {
printk(KERN_ERR "DMA Channel %d failed to suspend\n", i); printk(KERN_ERR "DMA Channel %d failed to suspend\n", i);
return -EBUSY; return -EBUSY;
@ -434,12 +433,7 @@ int blackfin_dma_suspend(void)
void blackfin_dma_resume(void) void blackfin_dma_resume(void)
{ {
int i; int i;
for (i = 0; i < MAX_DMA_SUSPEND_CHANNELS; ++i)
#ifdef CONFIG_BF561 /* IMDMA channels doesn't have a PERIPHERAL_MAP */
for (i = 0; i <= CH_MEM_STREAM3_SRC; i++)
#else
for (i = 0; i < MAX_DMA_CHANNELS; i++)
#endif
dma_ch[i].regs->peripheral_map = dma_ch[i].saved_peripheral_map; dma_ch[i].regs->peripheral_map = dma_ch[i].saved_peripheral_map;
} }
#endif #endif

View File

@ -10,6 +10,9 @@
#define MAX_DMA_CHANNELS 36 #define MAX_DMA_CHANNELS 36
/* [#4267] IMDMA channels have no PERIPHERAL_MAP MMR */
#define MAX_DMA_SUSPEND_CHANNELS 32
#define CH_PPI0 0 #define CH_PPI0 0
#define CH_PPI (CH_PPI0) #define CH_PPI (CH_PPI0)
#define CH_PPI1 1 #define CH_PPI1 1