aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/alchemy/common/dbdma.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/alchemy/common/dbdma.c')
-rw-r--r--arch/mips/alchemy/common/dbdma.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/arch/mips/alchemy/common/dbdma.c b/arch/mips/alchemy/common/dbdma.c
index 19c1c82849ff..f9201ca2295b 100644
--- a/arch/mips/alchemy/common/dbdma.c
+++ b/arch/mips/alchemy/common/dbdma.c
@@ -412,8 +412,11 @@ u32 au1xxx_dbdma_ring_alloc(u32 chanid, int entries)
412 if (desc_base == 0) 412 if (desc_base == 0)
413 return 0; 413 return 0;
414 414
415 ctp->cdb_membase = desc_base;
415 desc_base = ALIGN_ADDR(desc_base, sizeof(au1x_ddma_desc_t)); 416 desc_base = ALIGN_ADDR(desc_base, sizeof(au1x_ddma_desc_t));
416 } 417 } else
418 ctp->cdb_membase = desc_base;
419
417 dp = (au1x_ddma_desc_t *)desc_base; 420 dp = (au1x_ddma_desc_t *)desc_base;
418 421
419 /* Keep track of the base descriptor. */ 422 /* Keep track of the base descriptor. */
@@ -613,7 +616,7 @@ u32 _au1xxx_dbdma_put_source(u32 chanid, void *buf, int nbytes, u32 flags)
613 dma_cache_wback_inv((unsigned long)buf, nbytes); 616 dma_cache_wback_inv((unsigned long)buf, nbytes);
614 dp->dscr_cmd0 |= DSCR_CMD0_V; /* Let it rip */ 617 dp->dscr_cmd0 |= DSCR_CMD0_V; /* Let it rip */
615 au_sync(); 618 au_sync();
616 dma_cache_wback_inv((unsigned long)dp, sizeof(dp)); 619 dma_cache_wback_inv((unsigned long)dp, sizeof(*dp));
617 ctp->chan_ptr->ddma_dbell = 0; 620 ctp->chan_ptr->ddma_dbell = 0;
618 621
619 /* Get next descriptor pointer. */ 622 /* Get next descriptor pointer. */
@@ -676,7 +679,7 @@ _au1xxx_dbdma_put_dest(u32 chanid, void *buf, int nbytes, u32 flags)
676 dma_cache_inv((unsigned long)buf, nbytes); 679 dma_cache_inv((unsigned long)buf, nbytes);
677 dp->dscr_cmd0 |= DSCR_CMD0_V; /* Let it rip */ 680 dp->dscr_cmd0 |= DSCR_CMD0_V; /* Let it rip */
678 au_sync(); 681 au_sync();
679 dma_cache_wback_inv((unsigned long)dp, sizeof(dp)); 682 dma_cache_wback_inv((unsigned long)dp, sizeof(*dp));
680 ctp->chan_ptr->ddma_dbell = 0; 683 ctp->chan_ptr->ddma_dbell = 0;
681 684
682 /* Get next descriptor pointer. */ 685 /* Get next descriptor pointer. */
@@ -831,7 +834,7 @@ void au1xxx_dbdma_chan_free(u32 chanid)
831 834
832 au1xxx_dbdma_stop(chanid); 835 au1xxx_dbdma_stop(chanid);
833 836
834 kfree((void *)ctp->chan_desc_base); 837 kfree((void *)ctp->cdb_membase);
835 838
836 stp->dev_flags &= ~DEV_FLAGS_INUSE; 839 stp->dev_flags &= ~DEV_FLAGS_INUSE;
837 dtp->dev_flags &= ~DEV_FLAGS_INUSE; 840 dtp->dev_flags &= ~DEV_FLAGS_INUSE;