xburst: Add 3.10 support
[openwrt/svn-archive/archive.git] / target / linux / xburst / patches-3.10 / 014-MIPS-jz4740-Register-jz4740-DMA-device.patch
1 From 734bdfd446b1eba0c54ad07703a192e6093417fd Mon Sep 17 00:00:00 2001
2 From: Lars-Peter Clausen <lars@metafoo.de>
3 Date: Thu, 30 May 2013 18:25:03 +0200
4 Subject: [PATCH 14/16] MIPS: jz4740: Register jz4740 DMA device
5
6 Register a device for the newly added jz4740 dmaengine driver.
7
8 Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
9 Acked-by: Ralf Baechle <ralf@linux-mips.org>
10 [manually edited to align struct assignment]
11 Signed-off-by: Vinod Koul <vinod.koul@intel.com>
12 ---
13 arch/mips/include/asm/mach-jz4740/platform.h | 1 +
14 arch/mips/jz4740/board-qi_lb60.c | 1 +
15 arch/mips/jz4740/platform.c | 21 +++++++++++++++++++++
16 3 files changed, 23 insertions(+)
17
18 diff --git a/arch/mips/include/asm/mach-jz4740/platform.h b/arch/mips/include/asm/mach-jz4740/platform.h
19 index 72cfebd..05988c2 100644
20 --- a/arch/mips/include/asm/mach-jz4740/platform.h
21 +++ b/arch/mips/include/asm/mach-jz4740/platform.h
22 @@ -32,6 +32,7 @@ extern struct platform_device jz4740_codec_device;
23 extern struct platform_device jz4740_adc_device;
24 extern struct platform_device jz4740_wdt_device;
25 extern struct platform_device jz4740_pwm_device;
26 +extern struct platform_device jz4740_dma_device;
27
28 void jz4740_serial_device_register(void);
29
30 diff --git a/arch/mips/jz4740/board-qi_lb60.c b/arch/mips/jz4740/board-qi_lb60.c
31 index bc454e6..b857521 100644
32 --- a/arch/mips/jz4740/board-qi_lb60.c
33 +++ b/arch/mips/jz4740/board-qi_lb60.c
34 @@ -437,6 +437,7 @@ static struct platform_device *jz_platform_devices[] __initdata = {
35 &jz4740_rtc_device,
36 &jz4740_adc_device,
37 &jz4740_pwm_device,
38 + &jz4740_dma_device,
39 &qi_lb60_gpio_keys,
40 &qi_lb60_pwm_beeper,
41 &qi_lb60_charger_device,
42 diff --git a/arch/mips/jz4740/platform.c b/arch/mips/jz4740/platform.c
43 index e9348fd..df65677 100644
44 --- a/arch/mips/jz4740/platform.c
45 +++ b/arch/mips/jz4740/platform.c
46 @@ -329,3 +329,24 @@ struct platform_device jz4740_pwm_device = {
47 .name = "jz4740-pwm",
48 .id = -1,
49 };
50 +
51 +/* DMA */
52 +static struct resource jz4740_dma_resources[] = {
53 + {
54 + .start = JZ4740_DMAC_BASE_ADDR,
55 + .end = JZ4740_DMAC_BASE_ADDR + 0x400 - 1,
56 + .flags = IORESOURCE_MEM,
57 + },
58 + {
59 + .start = JZ4740_IRQ_DMAC,
60 + .end = JZ4740_IRQ_DMAC,
61 + .flags = IORESOURCE_IRQ,
62 + },
63 +};
64 +
65 +struct platform_device jz4740_dma_device = {
66 + .name = "jz4740-dma",
67 + .id = -1,
68 + .num_resources = ARRAY_SIZE(jz4740_dma_resources),
69 + .resource = jz4740_dma_resources,
70 +};
71 --
72 1.7.10.4
73