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/at91sam9263_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/at91sam9263_devices.c')
-rw-r--r-- | arch/arm/mach-at91/at91sam9263_devices.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c index 64aab9c9b97e..c81842c02706 100644 --- a/arch/arm/mach-at91/at91sam9263_devices.c +++ b/arch/arm/mach-at91/at91sam9263_devices.c | |||
@@ -788,6 +788,43 @@ void __init at91_add_device_isi(void) {} | |||
788 | 788 | ||
789 | 789 | ||
790 | /* -------------------------------------------------------------------- | 790 | /* -------------------------------------------------------------------- |
791 | * Timer/Counter block | ||
792 | * -------------------------------------------------------------------- */ | ||
793 | |||
794 | #ifdef CONFIG_ATMEL_TCLIB | ||
795 | |||
796 | static struct resource tcb_resources[] = { | ||
797 | [0] = { | ||
798 | .start = AT91SAM9263_BASE_TCB0, | ||
799 | .end = AT91SAM9263_BASE_TCB0 + SZ_16K - 1, | ||
800 | .flags = IORESOURCE_MEM, | ||
801 | }, | ||
802 | [1] = { | ||
803 | .start = AT91SAM9263_ID_TCB, | ||
804 | .end = AT91SAM9263_ID_TCB, | ||
805 | .flags = IORESOURCE_IRQ, | ||
806 | }, | ||
807 | }; | ||
808 | |||
809 | static struct platform_device at91sam9263_tcb_device = { | ||
810 | .name = "atmel_tcb", | ||
811 | .id = 0, | ||
812 | .resource = tcb_resources, | ||
813 | .num_resources = ARRAY_SIZE(tcb_resources), | ||
814 | }; | ||
815 | |||
816 | static void __init at91_add_device_tc(void) | ||
817 | { | ||
818 | /* this chip has one clock and irq for all three TC channels */ | ||
819 | at91_clock_associate("tcb_clk", &at91sam9263_tcb_device.dev, "t0_clk"); | ||
820 | platform_device_register(&at91sam9263_tcb_device); | ||
821 | } | ||
822 | #else | ||
823 | static void __init at91_add_device_tc(void) { } | ||
824 | #endif | ||
825 | |||
826 | |||
827 | /* -------------------------------------------------------------------- | ||
791 | * RTT | 828 | * RTT |
792 | * -------------------------------------------------------------------- */ | 829 | * -------------------------------------------------------------------- */ |
793 | 830 | ||
@@ -1262,6 +1299,7 @@ static int __init at91_add_standard_devices(void) | |||
1262 | { | 1299 | { |
1263 | at91_add_device_rtt(); | 1300 | at91_add_device_rtt(); |
1264 | at91_add_device_watchdog(); | 1301 | at91_add_device_watchdog(); |
1302 | at91_add_device_tc(); | ||
1265 | return 0; | 1303 | return 0; |
1266 | } | 1304 | } |
1267 | 1305 | ||