Date:2012-10-09 13:09:57 (7 years 9 months ago)
Author:Maarten ter Huurne
Commit:e817517876803ed28c965bf33d0bb1e74327ef59
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
921921
922922    return 0;
923923}
924arch_initcall(jz4740_clock_init);
924postcore_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>
...... 
268269
269270static int jz4740_dma_init(void)
270271{
272    struct clk *clk;
271273    unsigned int ret;
272274
273275    jz4740_dma_base = ioremap(JZ4740_DMAC_BASE_ADDR, 0x400);
...... 
277279
278280    spin_lock_init(&jz4740_dma_lock);
279281
280    ret = request_irq(JZ4740_IRQ_DMAC, jz4740_dma_irq, 0, "DMA", NULL);
282    clk = clk_get(NULL, "dma");
283    if (IS_ERR(clk)) {
284        ret = PTR_ERR(clk);
285        printk(KERN_ERR "JZ4740 DMA: Failed to request clock: %d\n",
286                ret);
287        goto err_iounmap;
288    }
281289
282    if (ret)
290    ret = request_irq(JZ4740_IRQ_DMAC, jz4740_dma_irq, 0, "DMA", NULL);
291    if (ret) {
283292        printk(KERN_ERR "JZ4740 DMA: Failed to request irq: %d\n", ret);
293        goto err_clkput;
294    }
295
296    clk_enable(clk);
297
298    return 0;
299
300err_clkput:
301    clk_put(clk);
284302
303err_iounmap:
304    iounmap(jz4740_dma_base);
285305    return ret;
286306}
287307arch_initcall(jz4740_dma_init);

Archive Download the corresponding diff file



interactive