aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-at91/at91sam9rl_devices.c
diff options
context:
space:
mode:
authorAndrew Victor <linux@maxim.org.za>2008-04-02 16:58:00 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-04-04 04:52:25 -0400
commite5f40bfaf309ec4cc27b717d48fb0824313e5ef8 (patch)
treea35c3051d900708487b5f2ffc6c44304c6f0db61 /arch/arm/mach-at91/at91sam9rl_devices.c
parent4fd9212cb9bad88ec7c8bf5313f53331905f957a (diff)
[ARM] 4909/1: [AT91] Timer/Counter Block platform_devices
Register platform_devices for the Timer/Counter Block peripherals found on the AT91RM9200, SAM9 & CAP9 processors. Original patch from David Brownell. Signed-off-by: Andrew Victor <linux@maxim.org.za> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-at91/at91sam9rl_devices.c')
-rw-r--r--arch/arm/mach-at91/at91sam9rl_devices.c50
1 files changed, 50 insertions, 0 deletions
diff --git a/arch/arm/mach-at91/at91sam9rl_devices.c b/arch/arm/mach-at91/at91sam9rl_devices.c
index 8982b02c8b46..892262a71d01 100644
--- a/arch/arm/mach-at91/at91sam9rl_devices.c
+++ b/arch/arm/mach-at91/at91sam9rl_devices.c
@@ -390,6 +390,55 @@ void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) {}
390 390
391 391
392/* -------------------------------------------------------------------- 392/* --------------------------------------------------------------------
393 * Timer/Counter block
394 * -------------------------------------------------------------------- */
395
396#ifdef CONFIG_ATMEL_TCLIB
397
398static struct resource tcb_resources[] = {
399 [0] = {
400 .start = AT91SAM9RL_BASE_TCB0,
401 .end = AT91SAM9RL_BASE_TCB0 + SZ_16K - 1,
402 .flags = IORESOURCE_MEM,
403 },
404 [1] = {
405 .start = AT91SAM9RL_ID_TC0,
406 .end = AT91SAM9RL_ID_TC0,
407 .flags = IORESOURCE_IRQ,
408 },
409 [2] = {
410 .start = AT91SAM9RL_ID_TC1,
411 .end = AT91SAM9RL_ID_TC1,
412 .flags = IORESOURCE_IRQ,
413 },
414 [3] = {
415 .start = AT91SAM9RL_ID_TC2,
416 .end = AT91SAM9RL_ID_TC2,
417 .flags = IORESOURCE_IRQ,
418 },
419};
420
421static struct platform_device at91sam9rl_tcb_device = {
422 .name = "atmel_tcb",
423 .id = 0,
424 .resource = tcb_resources,
425 .num_resources = ARRAY_SIZE(tcb_resources),
426};
427
428static void __init at91_add_device_tc(void)
429{
430 /* this chip has a separate clock and irq for each TC channel */
431 at91_clock_associate("tc0_clk", &at91sam9rl_tcb_device.dev, "t0_clk");
432 at91_clock_associate("tc1_clk", &at91sam9rl_tcb_device.dev, "t1_clk");
433 at91_clock_associate("tc2_clk", &at91sam9rl_tcb_device.dev, "t2_clk");
434 platform_device_register(&at91sam9rl_tcb_device);
435}
436#else
437static void __init at91_add_device_tc(void) { }
438#endif
439
440
441/* --------------------------------------------------------------------
393 * RTC 442 * RTC
394 * -------------------------------------------------------------------- */ 443 * -------------------------------------------------------------------- */
395 444
@@ -930,6 +979,7 @@ static int __init at91_add_standard_devices(void)
930 at91_add_device_rtc(); 979 at91_add_device_rtc();
931 at91_add_device_rtt(); 980 at91_add_device_rtt();
932 at91_add_device_watchdog(); 981 at91_add_device_watchdog();
982 at91_add_device_tc();
933 return 0; 983 return 0;
934} 984}
935 985