]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86/kernel/rtc.c
Merge branch 'for-bfields' of git://linux-nfs.org/~tomtucker/xprt-switch-2.6 into...
[linux-2.6-omap-h63xx.git] / arch / x86 / kernel / rtc.c
index 9615eee9b7759af8229e162066c4c6fab695015b..05191bbc68b8bef23926a60b28b461ca559e5502 100644 (file)
@@ -4,6 +4,8 @@
 #include <linux/acpi.h>
 #include <linux/bcd.h>
 #include <linux/mc146818rtc.h>
+#include <linux/platform_device.h>
+#include <linux/pnp.h>
 
 #include <asm/time.h>
 #include <asm/vsyscall.h>
@@ -197,3 +199,35 @@ unsigned long long native_read_tsc(void)
 }
 EXPORT_SYMBOL(native_read_tsc);
 
+
+static struct resource rtc_resources[] = {
+       [0] = {
+               .start  = RTC_PORT(0),
+               .end    = RTC_PORT(1),
+               .flags  = IORESOURCE_IO,
+       },
+       [1] = {
+               .start  = RTC_IRQ,
+               .end    = RTC_IRQ,
+               .flags  = IORESOURCE_IRQ,
+       }
+};
+
+static struct platform_device rtc_device = {
+       .name           = "rtc_cmos",
+       .id             = -1,
+       .resource       = rtc_resources,
+       .num_resources  = ARRAY_SIZE(rtc_resources),
+};
+
+static __init int add_rtc_cmos(void)
+{
+#ifdef CONFIG_PNP
+       if (!pnp_platform_devices)
+               platform_device_register(&rtc_device);
+#else
+       platform_device_register(&rtc_device);
+#endif /* CONFIG_PNP */
+       return 0;
+}
+device_initcall(add_rtc_cmos);