ARM: 6604/1: Gemini: add platform support for Gemini RTC
authorHans Ulli Kroll <ulli.kroll@googlemail.com>
Sun, 26 Dec 2010 10:02:29 +0000 (11:02 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Mon, 24 Jan 2011 17:23:30 +0000 (17:23 +0000)
adds rtc support for all Gemini SoC boards
nas4220b, rut1xx, wbd111, wbd222

Signed-off-by: Hans Ulli Kroll <ulli.kroll@googlemail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/mach-gemini/board-nas4220b.c
arch/arm/mach-gemini/board-rut1xx.c
arch/arm/mach-gemini/board-wbd111.c
arch/arm/mach-gemini/board-wbd222.c
arch/arm/mach-gemini/common.h
arch/arm/mach-gemini/devices.c

index 2ba096de00348e2be706127107eb2b845d2e83a1..0cf7a07c3f3f88f7309498b340a7603d0f8bd5f7 100644 (file)
@@ -98,6 +98,7 @@ static void __init ib4220b_init(void)
        platform_register_pflash(SZ_16M, NULL, 0);
        platform_device_register(&ib4220b_led_device);
        platform_device_register(&ib4220b_key_device);
+       platform_register_rtc();
 }
 
 MACHINE_START(NAS4220B, "Raidsonic NAS IB-4220-B")
index a9a0d8b0194296ab86072eb150fac5db5782af0e..4fa09af99495be2b48ad3dd1c73268849ef5e550 100644 (file)
@@ -82,6 +82,7 @@ static void __init rut1xx_init(void)
        platform_register_pflash(SZ_8M, NULL, 0);
        platform_device_register(&rut1xx_leds);
        platform_device_register(&rut1xx_keys_device);
+       platform_register_rtc();
 }
 
 MACHINE_START(RUT100, "Teltonika RUT100")
index 8b88d50d4337db51378737a70bfd4bc2959b7b3b..af7b68a6b2589385ae2996afb7f5da7645278608 100644 (file)
@@ -130,6 +130,7 @@ static void __init wbd111_init(void)
                                 wbd111_num_partitions);
        platform_device_register(&wbd111_leds_device);
        platform_device_register(&wbd111_keys_device);
+       platform_register_rtc();
 }
 
 MACHINE_START(WBD111, "Wiliboard WBD-111")
index 1eebcecd1c3312109213aba372cd915a2525961b..99e5bbecf923afd6a1c173308cfd6f6a6741e09a 100644 (file)
@@ -130,6 +130,7 @@ static void __init wbd222_init(void)
                wbd222_num_partitions);
        platform_device_register(&wbd222_leds_device);
        platform_device_register(&wbd222_keys_device);
+       platform_register_rtc();
 }
 
 MACHINE_START(WBD222, "Wiliboard WBD-222")
index 9392834a214f8b58e62f4e2bb83401129273f964..7670c39acb2f9f3463ccd678c675de4b84c27dba 100644 (file)
@@ -18,6 +18,7 @@ extern void gemini_map_io(void);
 extern void gemini_init_irq(void);
 extern void gemini_timer_init(void);
 extern void gemini_gpio_init(void);
+extern void platform_register_rtc(void);
 
 /* Common platform devices registration functions */
 extern int platform_register_uart(void);
index 6b525253d027293b7c5eca3a19cc205ce7faed67..5cff29818b7359d1e8dfaff33bfb8ed96bc28cfb 100644 (file)
@@ -90,3 +90,29 @@ int platform_register_pflash(unsigned int size, struct mtd_partition *parts,
 
        return platform_device_register(&pflash_device);
 }
+
+static struct resource gemini_rtc_resources[] = {
+       [0] = {
+               .start  = GEMINI_RTC_BASE,
+               .end    = GEMINI_RTC_BASE + 0x24,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = IRQ_RTC,
+               .end    = IRQ_RTC,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device gemini_rtc_device = {
+       .name           = "rtc-gemini",
+       .id             = 0,
+       .num_resources  = ARRAY_SIZE(gemini_rtc_resources),
+       .resource       = gemini_rtc_resources,
+};
+
+int __init platform_register_rtc(void)
+{
+       return platform_device_register(&gemini_rtc_device);
+}
+