Date:2012-05-06 03:19:38 (8 years 5 months ago)
Author:Maarten ter Huurne
Commit:759e3e2f8303922ee87833077d2b6c433ece194f
Message:MIPS: JZ4740: Acquire and enable DMA controller clock

Previously, it was assumed that the DMA controller clock is not gated
when the kernel starts running. While that is the power-on state, it is
safer to not rely on that.
Files: arch/mips/jz4740/clock.c (1 diff)
arch/mips/jz4740/dma.c (3 diffs)

Change Details

arch/mips/jz4740/clock.c
11311131
11321132    return 0;
11331133}
1134arch_initcall(jz4740_clock_init);
1134postcore_initcall(jz4740_clock_init);
arch/mips/jz4740/dma.c
1616#include <linux/kernel.h>
1717#include <linux/module.h>
1818#include <linux/spinlock.h>
19#include <linux/clk.h>
1920#include <linux/interrupt.h>
2021
2122#include <linux/dma-mapping.h>
...... 
276277
277278static int jz4740_dma_init(void)
278279{
280    struct clk *clk;
279281    unsigned int ret;
280282
281283    jz4740_dma_base = ioremap(JZ4740_DMAC_BASE_ADDR, 0x400);
...... 
284286
285287    spin_lock_init(&jz4740_dma_lock);
286288
289    clk = clk_get(NULL, "dma");
290    if (IS_ERR(clk)) {
291        ret = PTR_ERR(clk);
292        printk(KERN_ERR "JZ4740 DMA: Failed to request clock: %d\n",
293                ret);
294        goto err_iounmap;
295    }
296
287297    ret = request_irq(JZ4740_IRQ_DMAC, jz4740_dma_irq, 0, "DMA", NULL);
288298    if (ret) {
289299        printk(KERN_ERR "JZ4740 DMA: Failed to request irq: %d\n", ret);
290        goto err_iounmap;
300        goto err_clkput;
291301    }
292302
303    clk_enable(clk);
293304    jz4740_dma_write_mask(JZ_REG_DMA_CTRL,
294305                  JZ_DMA_CTRL_PRIORITY_ROUND_ROBIN,
295306                  JZ_DMA_CTRL_PRIORITY_MASK);
296307
297308    return 0;
298309
310err_clkput:
311    clk_put(clk);
312
299313err_iounmap:
300314    iounmap(jz4740_dma_base);
301315    return ret;

Archive Download the corresponding diff file



interactive