summaryrefslogtreecommitdiff
path: root/arch/arm/mach-mx25
diff options
context:
space:
mode:
authorRob Herring <r.herring@freescale.com>2010-03-08 15:23:58 -0600
committerAlejandro Gonzalez <alex.gonzalez@digi.com>2010-05-25 10:57:50 +0200
commitbf3fa686ebca341e65af73920792b5054508f381 (patch)
tree8586dff269323d50cfd59cef8b4dfd5913d96513 /arch/arm/mach-mx25
parentd07c4c722170a8ad6cbe2aef5e99f38f2f8a1886 (diff)
ENGR00121388 imx: make sdma a platform device
Convert sdma to a platform device and driver. Signed-off-by: Rob Herring <r.herring@freescale.com> Signed-off-by: Alejandro Gonzalez <alex.gonzalez@digi.com>
Diffstat (limited to 'arch/arm/mach-mx25')
-rw-r--r--arch/arm/mach-mx25/devices.c40
1 files changed, 27 insertions, 13 deletions
diff --git a/arch/arm/mach-mx25/devices.c b/arch/arm/mach-mx25/devices.c
index 0d9c0f130c08..093e8e146f20 100644
--- a/arch/arm/mach-mx25/devices.c
+++ b/arch/arm/mach-mx25/devices.c
@@ -14,6 +14,7 @@
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/io.h>
+#include <linux/dma-mapping.h>
#include <linux/platform_device.h>
#include <linux/clk.h>
#include <linux/spi/spi.h>
@@ -76,6 +77,32 @@ void mxc_sdma_get_script_info(sdma_script_start_addrs * sdma_script_addr)
sdma_script_addr->mxc_sdma_ram_code_start_addr = RAM_CODE_START_ADDR;
}
+static struct resource sdma_resources[] = {
+ {
+ .start = SDMA_BASE_ADDR,
+ .end = SDMA_BASE_ADDR + SZ_4K - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .start = MXC_INT_SDMA,
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+static struct platform_device mxc_dma_device = {
+ .name = "mxc_sdma",
+ .dev = {
+ .coherent_dma_mask = DMA_BIT_MASK(32),
+ },
+ .num_resources = ARRAY_SIZE(sdma_resources),
+ .resource = sdma_resources,
+};
+
+static inline void mxc_init_dma(void)
+{
+ (void)platform_device_register(&mxc_dma_device);
+}
+
static void mxc_nop_release(struct device *dev)
{
/* Nothing */
@@ -435,19 +462,6 @@ int __init mxc_register_gpios(void)
return mxc_gpio_init(mxc_gpio_ports, ARRAY_SIZE(mxc_gpio_ports));
}
-static struct platform_device mxc_dma_device = {
- .name = "mxc_dma",
- .id = 0,
- .dev = {
- .release = mxc_nop_release,
- },
-};
-
-static inline void mxc_init_dma(void)
-{
- (void)platform_device_register(&mxc_dma_device);
-}
-
/* imx adc driver */
#if defined(CONFIG_IMX_ADC) || defined(CONFIG_IMX_ADC_MODULE)