Skip to content

Commit

Permalink
Merge branch 'at91-fixes' of git://github.com/at91linux/linux-at91 in…
Browse files Browse the repository at this point in the history
…to 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
  • Loading branch information
arndb committed Mar 1, 2012
2 parents f2273ec + 851c52b commit 76374c6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 16 deletions.
19 changes: 10 additions & 9 deletions arch/arm/mach-at91/at91sam9g45_devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@
#if defined(CONFIG_AT_HDMAC) || defined(CONFIG_AT_HDMAC_MODULE)
static u64 hdmac_dmamask = DMA_BIT_MASK(32);

static struct at_dma_platform_data atdma_pdata = {
.nr_channels = 8,
};

static struct resource hdmac_resources[] = {
[0] = {
.start = AT91SAM9G45_BASE_DMA,
Expand All @@ -56,22 +52,27 @@ static struct resource hdmac_resources[] = {
};

static struct platform_device at_hdmac_device = {
.name = "at_hdmac",
.name = "at91sam9g45_dma",
.id = -1,
.dev = {
.dma_mask = &hdmac_dmamask,
.coherent_dma_mask = DMA_BIT_MASK(32),
.platform_data = &atdma_pdata,
},
.resource = hdmac_resources,
.num_resources = ARRAY_SIZE(hdmac_resources),
};

void __init at91_add_device_hdmac(void)
{
dma_cap_set(DMA_MEMCPY, atdma_pdata.cap_mask);
dma_cap_set(DMA_SLAVE, atdma_pdata.cap_mask);
platform_device_register(&at_hdmac_device);
#if defined(CONFIG_OF)
struct device_node *of_node =
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
void __init at91_add_device_hdmac(void) {}
Expand Down
8 changes: 1 addition & 7 deletions arch/arm/mach-at91/at91sam9rl_devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@
#if defined(CONFIG_AT_HDMAC) || defined(CONFIG_AT_HDMAC_MODULE)
static u64 hdmac_dmamask = DMA_BIT_MASK(32);

static struct at_dma_platform_data atdma_pdata = {
.nr_channels = 2,
};

static struct resource hdmac_resources[] = {
[0] = {
.start = AT91SAM9RL_BASE_DMA,
Expand All @@ -51,20 +47,18 @@ static struct resource hdmac_resources[] = {
};

static struct platform_device at_hdmac_device = {
.name = "at_hdmac",
.name = "at91sam9rl_dma",
.id = -1,
.dev = {
.dma_mask = &hdmac_dmamask,
.coherent_dma_mask = DMA_BIT_MASK(32),
.platform_data = &atdma_pdata,
},
.resource = hdmac_resources,
.num_resources = ARRAY_SIZE(hdmac_resources),
};

void __init at91_add_device_hdmac(void)
{
dma_cap_set(DMA_MEMCPY, atdma_pdata.cap_mask);
platform_device_register(&at_hdmac_device);
}
#else
Expand Down

0 comments on commit 76374c6

Please sign in to comment.