linux-mips
[Top] [All Lists]

[PATCH 4/6] MIPS: jz4740: Register jz4740 DMA device

To: Ralf Baechle <ralf@linux-mips.org>, Vinod Koul <vinod.koul@intel.com>, Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>
Subject: [PATCH 4/6] MIPS: jz4740: Register jz4740 DMA device
From: Lars-Peter Clausen <lars@metafoo.de>
Date: Thu, 23 May 2013 22:36:25 +0200
Cc: Maarten ter Huurne <maarten@treewalker.org>, linux-mips@linux-mips.org, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, Lars-Peter Clausen <lars@metafoo.de>
In-reply-to: <1369341387-19147-1-git-send-email-lars@metafoo.de>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1369341387-19147-1-git-send-email-lars@metafoo.de>
Sender: linux-mips-bounce@linux-mips.org
Register a device for the newly added jz4740 dmaengine driver.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 arch/mips/include/asm/mach-jz4740/platform.h |  1 +
 arch/mips/jz4740/board-qi_lb60.c             |  1 +
 arch/mips/jz4740/platform.c                  | 21 +++++++++++++++++++++
 3 files changed, 23 insertions(+)

diff --git a/arch/mips/include/asm/mach-jz4740/platform.h 
b/arch/mips/include/asm/mach-jz4740/platform.h
index 72cfebd..05988c2 100644
--- a/arch/mips/include/asm/mach-jz4740/platform.h
+++ b/arch/mips/include/asm/mach-jz4740/platform.h
@@ -32,6 +32,7 @@ extern struct platform_device jz4740_codec_device;
 extern struct platform_device jz4740_adc_device;
 extern struct platform_device jz4740_wdt_device;
 extern struct platform_device jz4740_pwm_device;
+extern struct platform_device jz4740_dma_device;
 
 void jz4740_serial_device_register(void);
 
diff --git a/arch/mips/jz4740/board-qi_lb60.c b/arch/mips/jz4740/board-qi_lb60.c
index be2b3de..8a5ec0e 100644
--- a/arch/mips/jz4740/board-qi_lb60.c
+++ b/arch/mips/jz4740/board-qi_lb60.c
@@ -438,6 +438,7 @@ static struct platform_device *jz_platform_devices[] 
__initdata = {
        &jz4740_rtc_device,
        &jz4740_adc_device,
        &jz4740_pwm_device,
+       &jz4740_dma_device,
        &qi_lb60_gpio_keys,
        &qi_lb60_pwm_beeper,
        &qi_lb60_charger_device,
diff --git a/arch/mips/jz4740/platform.c b/arch/mips/jz4740/platform.c
index e9348fd..35a9d8c 100644
--- a/arch/mips/jz4740/platform.c
+++ b/arch/mips/jz4740/platform.c
@@ -329,3 +329,24 @@ struct platform_device jz4740_pwm_device = {
        .name = "jz4740-pwm",
        .id   = -1,
 };
+
+/* DMA */
+static struct resource jz4740_dma_resources[] = {
+       {
+               .start  = JZ4740_DMAC_BASE_ADDR,
+               .end    = JZ4740_DMAC_BASE_ADDR + 0x400 - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       {
+               .start  = JZ4740_IRQ_DMAC,
+               .end    = JZ4740_IRQ_DMAC,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+struct platform_device jz4740_dma_device = {
+       .name   = "jz4740-dma",
+       .id     = -1,
+       .num_resources = ARRAY_SIZE(jz4740_dma_resources),
+       .resource      = jz4740_dma_resources,
+};
-- 
1.8.2.1


<Prev in Thread] Current Thread [Next in Thread>