diff options
author | Andrew Victor <linux@maxim.org.za> | 2008-04-02 16:58:00 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-04-04 04:52:25 -0400 |
commit | e5f40bfaf309ec4cc27b717d48fb0824313e5ef8 (patch) | |
tree | a35c3051d900708487b5f2ffc6c44304c6f0db61 /arch/arm/mach-at91/at91sam9261_devices.c | |
parent | 4fd9212cb9bad88ec7c8bf5313f53331905f957a (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/at91sam9261_devices.c')
-rw-r--r-- | arch/arm/mach-at91/at91sam9261_devices.c | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c index 0bd0edf8fa3b..03cd32482eac 100644 --- a/arch/arm/mach-at91/at91sam9261_devices.c +++ b/arch/arm/mach-at91/at91sam9261_devices.c | |||
@@ -548,6 +548,55 @@ void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) {} | |||
548 | 548 | ||
549 | 549 | ||
550 | /* -------------------------------------------------------------------- | 550 | /* -------------------------------------------------------------------- |
551 | * Timer/Counter block | ||
552 | * -------------------------------------------------------------------- */ | ||
553 | |||
554 | #ifdef CONFIG_ATMEL_TCLIB | ||
555 | |||
556 | static struct resource tcb_resources[] = { | ||
557 | [0] = { | ||
558 | .start = AT91SAM9261_BASE_TCB0, | ||
559 | .end = AT91SAM9261_BASE_TCB0 + SZ_16K - 1, | ||
560 | .flags = IORESOURCE_MEM, | ||
561 | }, | ||
562 | [1] = { | ||
563 | .start = AT91SAM9261_ID_TC0, | ||
564 | .end = AT91SAM9261_ID_TC0, | ||
565 | .flags = IORESOURCE_IRQ, | ||
566 | }, | ||
567 | [2] = { | ||
568 | .start = AT91SAM9261_ID_TC1, | ||
569 | .end = AT91SAM9261_ID_TC1, | ||
570 | .flags = IORESOURCE_IRQ, | ||
571 | }, | ||
572 | [3] = { | ||
573 | .start = AT91SAM9261_ID_TC2, | ||
574 | .end = AT91SAM9261_ID_TC2, | ||
575 | .flags = IORESOURCE_IRQ, | ||
576 | }, | ||
577 | }; | ||
578 | |||
579 | static struct platform_device at91sam9261_tcb_device = { | ||
580 | .name = "atmel_tcb", | ||
581 | .id = 0, | ||
582 | .resource = tcb_resources, | ||
583 | .num_resources = ARRAY_SIZE(tcb_resources), | ||
584 | }; | ||
585 | |||
586 | static void __init at91_add_device_tc(void) | ||
587 | { | ||
588 | /* this chip has a separate clock and irq for each TC channel */ | ||
589 | at91_clock_associate("tc0_clk", &at91sam9261_tcb_device.dev, "t0_clk"); | ||
590 | at91_clock_associate("tc1_clk", &at91sam9261_tcb_device.dev, "t1_clk"); | ||
591 | at91_clock_associate("tc2_clk", &at91sam9261_tcb_device.dev, "t2_clk"); | ||
592 | platform_device_register(&at91sam9261_tcb_device); | ||
593 | } | ||
594 | #else | ||
595 | static void __init at91_add_device_tc(void) { } | ||
596 | #endif | ||
597 | |||
598 | |||
599 | /* -------------------------------------------------------------------- | ||
551 | * RTT | 600 | * RTT |
552 | * -------------------------------------------------------------------- */ | 601 | * -------------------------------------------------------------------- */ |
553 | 602 | ||
@@ -1050,6 +1099,7 @@ static int __init at91_add_standard_devices(void) | |||
1050 | { | 1099 | { |
1051 | at91_add_device_rtt(); | 1100 | at91_add_device_rtt(); |
1052 | at91_add_device_watchdog(); | 1101 | at91_add_device_watchdog(); |
1102 | at91_add_device_tc(); | ||
1053 | return 0; | 1103 | return 0; |
1054 | } | 1104 | } |
1055 | 1105 | ||