aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-at91/at91sam9g45_devices.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-at91/at91sam9g45_devices.c')
-rw-r--r--arch/arm/mach-at91/at91sam9g45_devices.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c
index b7582dd10dc3..96e2adcd5a84 100644
--- a/arch/arm/mach-at91/at91sam9g45_devices.c
+++ b/arch/arm/mach-at91/at91sam9g45_devices.c
@@ -38,10 +38,6 @@
38#if defined(CONFIG_AT_HDMAC) || defined(CONFIG_AT_HDMAC_MODULE) 38#if defined(CONFIG_AT_HDMAC) || defined(CONFIG_AT_HDMAC_MODULE)
39static u64 hdmac_dmamask = DMA_BIT_MASK(32); 39static u64 hdmac_dmamask = DMA_BIT_MASK(32);
40 40
41static struct at_dma_platform_data atdma_pdata = {
42 .nr_channels = 8,
43};
44
45static struct resource hdmac_resources[] = { 41static struct resource hdmac_resources[] = {
46 [0] = { 42 [0] = {
47 .start = AT91SAM9G45_BASE_DMA, 43 .start = AT91SAM9G45_BASE_DMA,
@@ -56,12 +52,11 @@ static struct resource hdmac_resources[] = {
56}; 52};
57 53
58static struct platform_device at_hdmac_device = { 54static struct platform_device at_hdmac_device = {
59 .name = "at_hdmac", 55 .name = "at91sam9g45_dma",
60 .id = -1, 56 .id = -1,
61 .dev = { 57 .dev = {
62 .dma_mask = &hdmac_dmamask, 58 .dma_mask = &hdmac_dmamask,
63 .coherent_dma_mask = DMA_BIT_MASK(32), 59 .coherent_dma_mask = DMA_BIT_MASK(32),
64 .platform_data = &atdma_pdata,
65 }, 60 },
66 .resource = hdmac_resources, 61 .resource = hdmac_resources,
67 .num_resources = ARRAY_SIZE(hdmac_resources), 62 .num_resources = ARRAY_SIZE(hdmac_resources),
@@ -69,9 +64,15 @@ static struct platform_device at_hdmac_device = {
69 64
70void __init at91_add_device_hdmac(void) 65void __init at91_add_device_hdmac(void)
71{ 66{
72 dma_cap_set(DMA_MEMCPY, atdma_pdata.cap_mask); 67#if defined(CONFIG_OF)
73 dma_cap_set(DMA_SLAVE, atdma_pdata.cap_mask); 68 struct device_node *of_node =
74 platform_device_register(&at_hdmac_device); 69 of_find_node_by_name(NULL, "dma-controller");
70
71 if (of_node)
72 of_node_put(of_node);
73 else
74#endif
75 platform_device_register(&at_hdmac_device);
75} 76}
76#else 77#else
77void __init at91_add_device_hdmac(void) {} 78void __init at91_add_device_hdmac(void) {}