Commit 76374c63 authored by Arnd Bergmann's avatar Arnd Bergmann

Merge branch 'at91-fixes' of git://github.com/at91linux/linux-at91 into fixes

* 'at91-fixes' of git://github.com/at91linux/linux-at91:
  ARM: at91/dma: DMA controller registering with DT support
  ARM: at91/dma: remove platform data from DMA controller
parents f2273ecd 851c52b2
...@@ -38,10 +38,6 @@ ...@@ -38,10 +38,6 @@
#if defined(CONFIG_AT_HDMAC) || defined(CONFIG_AT_HDMAC_MODULE) #if defined(CONFIG_AT_HDMAC) || defined(CONFIG_AT_HDMAC_MODULE)
static u64 hdmac_dmamask = DMA_BIT_MASK(32); static u64 hdmac_dmamask = DMA_BIT_MASK(32);
static struct at_dma_platform_data atdma_pdata = {
.nr_channels = 8,
};
static struct resource hdmac_resources[] = { static struct resource hdmac_resources[] = {
[0] = { [0] = {
.start = AT91SAM9G45_BASE_DMA, .start = AT91SAM9G45_BASE_DMA,
...@@ -56,12 +52,11 @@ static struct resource hdmac_resources[] = { ...@@ -56,12 +52,11 @@ static struct resource hdmac_resources[] = {
}; };
static struct platform_device at_hdmac_device = { static struct platform_device at_hdmac_device = {
.name = "at_hdmac", .name = "at91sam9g45_dma",
.id = -1, .id = -1,
.dev = { .dev = {
.dma_mask = &hdmac_dmamask, .dma_mask = &hdmac_dmamask,
.coherent_dma_mask = DMA_BIT_MASK(32), .coherent_dma_mask = DMA_BIT_MASK(32),
.platform_data = &atdma_pdata,
}, },
.resource = hdmac_resources, .resource = hdmac_resources,
.num_resources = ARRAY_SIZE(hdmac_resources), .num_resources = ARRAY_SIZE(hdmac_resources),
...@@ -69,9 +64,15 @@ static struct platform_device at_hdmac_device = { ...@@ -69,9 +64,15 @@ static struct platform_device at_hdmac_device = {
void __init at91_add_device_hdmac(void) void __init at91_add_device_hdmac(void)
{ {
dma_cap_set(DMA_MEMCPY, atdma_pdata.cap_mask); #if defined(CONFIG_OF)
dma_cap_set(DMA_SLAVE, atdma_pdata.cap_mask); struct device_node *of_node =
platform_device_register(&at_hdmac_device); of_find_node_by_name(NULL, "dma-controller");
if (of_node)
of_node_put(of_node);
else
#endif
platform_device_register(&at_hdmac_device);
} }
#else #else
void __init at91_add_device_hdmac(void) {} void __init at91_add_device_hdmac(void) {}
......
...@@ -33,10 +33,6 @@ ...@@ -33,10 +33,6 @@
#if defined(CONFIG_AT_HDMAC) || defined(CONFIG_AT_HDMAC_MODULE) #if defined(CONFIG_AT_HDMAC) || defined(CONFIG_AT_HDMAC_MODULE)
static u64 hdmac_dmamask = DMA_BIT_MASK(32); static u64 hdmac_dmamask = DMA_BIT_MASK(32);
static struct at_dma_platform_data atdma_pdata = {
.nr_channels = 2,
};
static struct resource hdmac_resources[] = { static struct resource hdmac_resources[] = {
[0] = { [0] = {
.start = AT91SAM9RL_BASE_DMA, .start = AT91SAM9RL_BASE_DMA,
...@@ -51,12 +47,11 @@ static struct resource hdmac_resources[] = { ...@@ -51,12 +47,11 @@ static struct resource hdmac_resources[] = {
}; };
static struct platform_device at_hdmac_device = { static struct platform_device at_hdmac_device = {
.name = "at_hdmac", .name = "at91sam9rl_dma",
.id = -1, .id = -1,
.dev = { .dev = {
.dma_mask = &hdmac_dmamask, .dma_mask = &hdmac_dmamask,
.coherent_dma_mask = DMA_BIT_MASK(32), .coherent_dma_mask = DMA_BIT_MASK(32),
.platform_data = &atdma_pdata,
}, },
.resource = hdmac_resources, .resource = hdmac_resources,
.num_resources = ARRAY_SIZE(hdmac_resources), .num_resources = ARRAY_SIZE(hdmac_resources),
...@@ -64,7 +59,6 @@ static struct platform_device at_hdmac_device = { ...@@ -64,7 +59,6 @@ static struct platform_device at_hdmac_device = {
void __init at91_add_device_hdmac(void) void __init at91_add_device_hdmac(void)
{ {
dma_cap_set(DMA_MEMCPY, atdma_pdata.cap_mask);
platform_device_register(&at_hdmac_device); platform_device_register(&at_hdmac_device);
} }
#else #else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment