diff options
author | Andrew Victor <linux@maxim.org.za> | 2008-01-23 03:11:13 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-01-26 10:00:31 -0500 |
commit | 884f5a6a8dc8646d5904f166adf3c558be57e1ab (patch) | |
tree | c8d6283782b9d0f00d380052276c066d289c73d5 /arch/arm/mach-at91/at91sam9rl_devices.c | |
parent | e2920802351b3e01a3e70a26bb1bbb22f29da4cb (diff) |
[ARM] 4752/1: [AT91] RTT, RTC and WDT peripherals on SAM9
Add platform_device and initialization for the RTT (Real Time Timer)
and WDT (Watchdog) integrated in the Atmel AT91SAM9 processors.
For SAM9263, register both RTT peripherals.
[From: David Brownell <dbrownell@users.sourceforge.net>]
Provide platform_resources for RTT peripherals
[From: David Brownell <dbrownell@users.sourceforge.net>]
Add support for RTC peripheral on AT91SAM9RL (same RTC peripherals as
AT91RM9200)
[From: David Brownell <dbrownell@users.sourceforge.net>]
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.c | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/arch/arm/mach-at91/at91sam9rl_devices.c b/arch/arm/mach-at91/at91sam9rl_devices.c index 2bd60a3dc623..19ca71d3faab 100644 --- a/arch/arm/mach-at91/at91sam9rl_devices.c +++ b/arch/arm/mach-at91/at91sam9rl_devices.c | |||
@@ -384,6 +384,71 @@ void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) {} | |||
384 | 384 | ||
385 | 385 | ||
386 | /* -------------------------------------------------------------------- | 386 | /* -------------------------------------------------------------------- |
387 | * RTC | ||
388 | * -------------------------------------------------------------------- */ | ||
389 | |||
390 | #if defined(CONFIG_RTC_DRV_AT91RM9200) || defined(CONFIG_RTC_DRV_AT91RM9200_MODULE) | ||
391 | static struct platform_device at91sam9rl_rtc_device = { | ||
392 | .name = "at91_rtc", | ||
393 | .id = -1, | ||
394 | .num_resources = 0, | ||
395 | }; | ||
396 | |||
397 | static void __init at91_add_device_rtc(void) | ||
398 | { | ||
399 | platform_device_register(&at91sam9rl_rtc_device); | ||
400 | } | ||
401 | #else | ||
402 | static void __init at91_add_device_rtc(void) {} | ||
403 | #endif | ||
404 | |||
405 | |||
406 | /* -------------------------------------------------------------------- | ||
407 | * RTT | ||
408 | * -------------------------------------------------------------------- */ | ||
409 | |||
410 | static struct resource rtt_resources[] = { | ||
411 | { | ||
412 | .start = AT91_BASE_SYS + AT91_RTT, | ||
413 | .end = AT91_BASE_SYS + AT91_RTT + SZ_16 - 1, | ||
414 | .flags = IORESOURCE_MEM, | ||
415 | } | ||
416 | }; | ||
417 | |||
418 | static struct platform_device at91sam9rl_rtt_device = { | ||
419 | .name = "at91_rtt", | ||
420 | .id = -1, | ||
421 | .resource = rtt_resources, | ||
422 | .num_resources = ARRAY_SIZE(rtt_resources), | ||
423 | }; | ||
424 | |||
425 | static void __init at91_add_device_rtt(void) | ||
426 | { | ||
427 | platform_device_register(&at91sam9rl_rtt_device); | ||
428 | } | ||
429 | |||
430 | |||
431 | /* -------------------------------------------------------------------- | ||
432 | * Watchdog | ||
433 | * -------------------------------------------------------------------- */ | ||
434 | |||
435 | #if defined(CONFIG_AT91SAM9_WATCHDOG) || defined(CONFIG_AT91SAM9_WATCHDOG_MODULE) | ||
436 | static struct platform_device at91sam9rl_wdt_device = { | ||
437 | .name = "at91_wdt", | ||
438 | .id = -1, | ||
439 | .num_resources = 0, | ||
440 | }; | ||
441 | |||
442 | static void __init at91_add_device_watchdog(void) | ||
443 | { | ||
444 | platform_device_register(&at91sam9rl_wdt_device); | ||
445 | } | ||
446 | #else | ||
447 | static void __init at91_add_device_watchdog(void) {} | ||
448 | #endif | ||
449 | |||
450 | |||
451 | /* -------------------------------------------------------------------- | ||
387 | * LEDs | 452 | * LEDs |
388 | * -------------------------------------------------------------------- */ | 453 | * -------------------------------------------------------------------- */ |
389 | 454 | ||
@@ -659,6 +724,9 @@ void __init at91_add_device_serial(void) {} | |||
659 | */ | 724 | */ |
660 | static int __init at91_add_standard_devices(void) | 725 | static int __init at91_add_standard_devices(void) |
661 | { | 726 | { |
727 | at91_add_device_rtc(); | ||
728 | at91_add_device_rtt(); | ||
729 | at91_add_device_watchdog(); | ||
662 | return 0; | 730 | return 0; |
663 | } | 731 | } |
664 | 732 | ||