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/at91cap9_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/at91cap9_devices.c')
-rw-r--r-- | arch/arm/mach-at91/at91cap9_devices.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/arch/arm/mach-at91/at91cap9_devices.c b/arch/arm/mach-at91/at91cap9_devices.c index 7d782ee4117b..2eeaf5d5bbf3 100644 --- a/arch/arm/mach-at91/at91cap9_devices.c +++ b/arch/arm/mach-at91/at91cap9_devices.c | |||
@@ -537,6 +537,43 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices) | |||
537 | 537 | ||
538 | 538 | ||
539 | /* -------------------------------------------------------------------- | 539 | /* -------------------------------------------------------------------- |
540 | * Timer/Counter block | ||
541 | * -------------------------------------------------------------------- */ | ||
542 | |||
543 | #ifdef CONFIG_ATMEL_TCLIB | ||
544 | |||
545 | static struct resource tcb_resources[] = { | ||
546 | [0] = { | ||
547 | .start = AT91CAP9_BASE_TCB0, | ||
548 | .end = AT91CAP9_BASE_TCB0 + SZ_16K - 1, | ||
549 | .flags = IORESOURCE_MEM, | ||
550 | }, | ||
551 | [1] = { | ||
552 | .start = AT91CAP9_ID_TCB, | ||
553 | .end = AT91CAP9_ID_TCB, | ||
554 | .flags = IORESOURCE_IRQ, | ||
555 | }, | ||
556 | }; | ||
557 | |||
558 | static struct platform_device at91cap9_tcb_device = { | ||
559 | .name = "atmel_tcb", | ||
560 | .id = 0, | ||
561 | .resource = tcb_resources, | ||
562 | .num_resources = ARRAY_SIZE(tcb_resources), | ||
563 | }; | ||
564 | |||
565 | static void __init at91_add_device_tc(void) | ||
566 | { | ||
567 | /* this chip has one clock and irq for all three TC channels */ | ||
568 | at91_clock_associate("tcb_clk", &at91cap9_tcb_device.dev, "t0_clk"); | ||
569 | platform_device_register(&at91cap9_tcb_device); | ||
570 | } | ||
571 | #else | ||
572 | static void __init at91_add_device_tc(void) { } | ||
573 | #endif | ||
574 | |||
575 | |||
576 | /* -------------------------------------------------------------------- | ||
540 | * RTT | 577 | * RTT |
541 | * -------------------------------------------------------------------- */ | 578 | * -------------------------------------------------------------------- */ |
542 | 579 | ||
@@ -1074,6 +1111,7 @@ static int __init at91_add_standard_devices(void) | |||
1074 | { | 1111 | { |
1075 | at91_add_device_rtt(); | 1112 | at91_add_device_rtt(); |
1076 | at91_add_device_watchdog(); | 1113 | at91_add_device_watchdog(); |
1114 | at91_add_device_tc(); | ||
1077 | return 0; | 1115 | return 0; |
1078 | } | 1116 | } |
1079 | 1117 | ||