X-Git-Url: http://www.pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=arch%2Farm%2Fmach-at91%2Fat91cap9_devices.c;h=2eeaf5d5bbf36fe2c9f4875994c623f37dccfa7e;hb=e5f40bfaf309ec4cc27b717d48fb0824313e5ef8;hp=7d782ee4117b8cc529ab67c5d66e43b9008c4c50;hpb=4fd9212cb9bad88ec7c8bf5313f53331905f957a;p=linux-2.6-omap-h63xx.git diff --git a/arch/arm/mach-at91/at91cap9_devices.c b/arch/arm/mach-at91/at91cap9_devices.c index 7d782ee4117..2eeaf5d5bbf 100644 --- a/arch/arm/mach-at91/at91cap9_devices.c +++ b/arch/arm/mach-at91/at91cap9_devices.c @@ -536,6 +536,43 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices) #endif +/* -------------------------------------------------------------------- + * Timer/Counter block + * -------------------------------------------------------------------- */ + +#ifdef CONFIG_ATMEL_TCLIB + +static struct resource tcb_resources[] = { + [0] = { + .start = AT91CAP9_BASE_TCB0, + .end = AT91CAP9_BASE_TCB0 + SZ_16K - 1, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = AT91CAP9_ID_TCB, + .end = AT91CAP9_ID_TCB, + .flags = IORESOURCE_IRQ, + }, +}; + +static struct platform_device at91cap9_tcb_device = { + .name = "atmel_tcb", + .id = 0, + .resource = tcb_resources, + .num_resources = ARRAY_SIZE(tcb_resources), +}; + +static void __init at91_add_device_tc(void) +{ + /* this chip has one clock and irq for all three TC channels */ + at91_clock_associate("tcb_clk", &at91cap9_tcb_device.dev, "t0_clk"); + platform_device_register(&at91cap9_tcb_device); +} +#else +static void __init at91_add_device_tc(void) { } +#endif + + /* -------------------------------------------------------------------- * RTT * -------------------------------------------------------------------- */ @@ -1074,6 +1111,7 @@ static int __init at91_add_standard_devices(void) { at91_add_device_rtt(); at91_add_device_watchdog(); + at91_add_device_tc(); return 0; }