summaryrefslogtreecommitdiff
path: root/arch/arm/mach-at91/at91sam9260_devices.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2012-03-02 13:22:28 +0000
committerArnd Bergmann <arnd@arndb.de>2012-03-02 13:22:28 +0000
commit48b3b08e00012382cb52099e509b529305ae0a00 (patch)
tree0b5ff03c195707e3e545731121bc4537a3b42ac4 /arch/arm/mach-at91/at91sam9260_devices.c
parent6e1d521b9d1201214ec4a67a7e4360232be5f963 (diff)
parentf75622f4679479d352d2fa83e0d84c6c13cfcb5f (diff)
Merge branch 'at91-3.4-cleanup2+DT' of git://github.com/at91linux/linux-at91 into next/dt
* 'at91-3.4-cleanup2+DT' of git://github.com/at91linux/linux-at91: (22 commits) ARM: at91: at91sam9x5cm/dt: add leds support ARM: at91: usb_a9g20/dt: add gpio-keys support ARM: at91: at91sam9m10g45ek/dt: add gpio-keys support ARM: at91: at91sam9m10g45ek/dt: add leds support ARM: at91: usb_a9g20/dt: add leds support ARM: at91/pio: add new PIO3 features ARM: at91: add sam9_smc.o to at91sam9x5 build ARM: at91/tc/clocksource: Add 32 bit variant to Timer Counter ARM: at91/tc: add device tree support to atmel_tclib ARM: at91/tclib: take iomem size from resource ARM: at91/pit: add traces in case of error ARM: at91: pit add DT support ARM: at91: AIC and GPIO IRQ device tree initialization ARM: at91/board-dt: remove AIC irq domain from board file ARM: at91/gpio: remove the static specification of gpio_chip.base ARM: at91/gpio: add .to_irq gpio_chip handler ARM: at91/gpio: non-DT builds do not have gpio_chip.of_node field ARM: at91/gpio: add irqdomain and DT support ARM: at91/gpio: change comments and one variable name ARM/USB: at91/ohci-at91: remove the use of irq_to_gpio ...
Diffstat (limited to 'arch/arm/mach-at91/at91sam9260_devices.c')
-rw-r--r--arch/arm/mach-at91/at91sam9260_devices.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/arch/arm/mach-at91/at91sam9260_devices.c b/arch/arm/mach-at91/at91sam9260_devices.c
index 40f6aeaea043..7e5651ee9f85 100644
--- a/arch/arm/mach-at91/at91sam9260_devices.c
+++ b/arch/arm/mach-at91/at91sam9260_devices.c
@@ -642,7 +642,7 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices)
static struct resource tcb0_resources[] = {
[0] = {
.start = AT91SAM9260_BASE_TCB0,
- .end = AT91SAM9260_BASE_TCB0 + SZ_16K - 1,
+ .end = AT91SAM9260_BASE_TCB0 + SZ_256 - 1,
.flags = IORESOURCE_MEM,
},
[1] = {
@@ -672,7 +672,7 @@ static struct platform_device at91sam9260_tcb0_device = {
static struct resource tcb1_resources[] = {
[0] = {
.start = AT91SAM9260_BASE_TCB1,
- .end = AT91SAM9260_BASE_TCB1 + SZ_16K - 1,
+ .end = AT91SAM9260_BASE_TCB1 + SZ_256 - 1,
.flags = IORESOURCE_MEM,
},
[1] = {
@@ -699,8 +699,25 @@ static struct platform_device at91sam9260_tcb1_device = {
.num_resources = ARRAY_SIZE(tcb1_resources),
};
+#if defined(CONFIG_OF)
+static struct of_device_id tcb_ids[] = {
+ { .compatible = "atmel,at91rm9200-tcb" },
+ { /*sentinel*/ }
+};
+#endif
+
static void __init at91_add_device_tc(void)
{
+#if defined(CONFIG_OF)
+ struct device_node *np;
+
+ np = of_find_matching_node(NULL, tcb_ids);
+ if (np) {
+ of_node_put(np);
+ return;
+ }
+#endif
+
platform_device_register(&at91sam9260_tcb0_device);
platform_device_register(&at91sam9260_tcb1_device);
}