kernel: update 3.10 to 3.10.3
[openwrt.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 --- a/arch/mips/include/asm/mach-jz4740/platform.h
19 +++ b/arch/mips/include/asm/mach-jz4740/platform.h
20 @@ -32,6 +32,7 @@ extern struct platform_device jz4740_cod
21  extern struct platform_device jz4740_adc_device;
22  extern struct platform_device jz4740_wdt_device;
23  extern struct platform_device jz4740_pwm_device;
24 +extern struct platform_device jz4740_dma_device;
25  
26  void jz4740_serial_device_register(void);
27  
28 --- a/arch/mips/jz4740/board-qi_lb60.c
29 +++ b/arch/mips/jz4740/board-qi_lb60.c
30 @@ -437,6 +437,7 @@ static struct platform_device *jz_platfo
31         &jz4740_rtc_device,
32         &jz4740_adc_device,
33         &jz4740_pwm_device,
34 +       &jz4740_dma_device,
35         &qi_lb60_gpio_keys,
36         &qi_lb60_pwm_beeper,
37         &qi_lb60_charger_device,
38 --- a/arch/mips/jz4740/platform.c
39 +++ b/arch/mips/jz4740/platform.c
40 @@ -329,3 +329,24 @@ struct platform_device jz4740_pwm_device
41         .name = "jz4740-pwm",
42         .id   = -1,
43  };
44 +
45 +/* DMA */
46 +static struct resource jz4740_dma_resources[] = {
47 +       {
48 +               .start  = JZ4740_DMAC_BASE_ADDR,
49 +               .end    = JZ4740_DMAC_BASE_ADDR + 0x400 - 1,
50 +               .flags  = IORESOURCE_MEM,
51 +       },
52 +       {
53 +               .start  = JZ4740_IRQ_DMAC,
54 +               .end    = JZ4740_IRQ_DMAC,
55 +               .flags  = IORESOURCE_IRQ,
56 +       },
57 +};
58 +
59 +struct platform_device jz4740_dma_device = {
60 +       .name           = "jz4740-dma",
61 +       .id             = -1,
62 +       .num_resources  = ARRAY_SIZE(jz4740_dma_resources),
63 +       .resource       = jz4740_dma_resources,
64 +};