aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-at91/at91sam9rl_devices.c
diff options
context:
space:
mode:
authorAndrew Victor <linux@maxim.org.za>2008-01-23 03:11:13 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-01-26 10:00:31 -0500
commit884f5a6a8dc8646d5904f166adf3c558be57e1ab (patch)
treec8d6283782b9d0f00d380052276c066d289c73d5 /arch/arm/mach-at91/at91sam9rl_devices.c
parente2920802351b3e01a3e70a26bb1bbb22f29da4cb (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.c68
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)
391static struct platform_device at91sam9rl_rtc_device = {
392 .name = "at91_rtc",
393 .id = -1,
394 .num_resources = 0,
395};
396
397static void __init at91_add_device_rtc(void)
398{
399 platform_device_register(&at91sam9rl_rtc_device);
400}
401#else
402static void __init at91_add_device_rtc(void) {}
403#endif
404
405
406/* --------------------------------------------------------------------
407 * RTT
408 * -------------------------------------------------------------------- */
409
410static 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
418static 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
425static 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)
436static struct platform_device at91sam9rl_wdt_device = {
437 .name = "at91_wdt",
438 .id = -1,
439 .num_resources = 0,
440};
441
442static void __init at91_add_device_watchdog(void)
443{
444 platform_device_register(&at91sam9rl_wdt_device);
445}
446#else
447static 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 */
660static int __init at91_add_standard_devices(void) 725static 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