diff options
Diffstat (limited to 'arch/x86/kernel/rtc.c')
| -rw-r--r-- | arch/x86/kernel/rtc.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/arch/x86/kernel/rtc.c b/arch/x86/kernel/rtc.c index 9615eee9b775..05191bbc68b8 100644 --- a/arch/x86/kernel/rtc.c +++ b/arch/x86/kernel/rtc.c | |||
| @@ -4,6 +4,8 @@ | |||
| 4 | #include <linux/acpi.h> | 4 | #include <linux/acpi.h> |
| 5 | #include <linux/bcd.h> | 5 | #include <linux/bcd.h> |
| 6 | #include <linux/mc146818rtc.h> | 6 | #include <linux/mc146818rtc.h> |
| 7 | #include <linux/platform_device.h> | ||
| 8 | #include <linux/pnp.h> | ||
| 7 | 9 | ||
| 8 | #include <asm/time.h> | 10 | #include <asm/time.h> |
| 9 | #include <asm/vsyscall.h> | 11 | #include <asm/vsyscall.h> |
| @@ -197,3 +199,35 @@ unsigned long long native_read_tsc(void) | |||
| 197 | } | 199 | } |
| 198 | EXPORT_SYMBOL(native_read_tsc); | 200 | EXPORT_SYMBOL(native_read_tsc); |
| 199 | 201 | ||
| 202 | |||
| 203 | static struct resource rtc_resources[] = { | ||
| 204 | [0] = { | ||
| 205 | .start = RTC_PORT(0), | ||
| 206 | .end = RTC_PORT(1), | ||
| 207 | .flags = IORESOURCE_IO, | ||
| 208 | }, | ||
| 209 | [1] = { | ||
| 210 | .start = RTC_IRQ, | ||
| 211 | .end = RTC_IRQ, | ||
| 212 | .flags = IORESOURCE_IRQ, | ||
| 213 | } | ||
| 214 | }; | ||
| 215 | |||
| 216 | static struct platform_device rtc_device = { | ||
| 217 | .name = "rtc_cmos", | ||
| 218 | .id = -1, | ||
| 219 | .resource = rtc_resources, | ||
| 220 | .num_resources = ARRAY_SIZE(rtc_resources), | ||
| 221 | }; | ||
| 222 | |||
| 223 | static __init int add_rtc_cmos(void) | ||
| 224 | { | ||
| 225 | #ifdef CONFIG_PNP | ||
| 226 | if (!pnp_platform_devices) | ||
| 227 | platform_device_register(&rtc_device); | ||
| 228 | #else | ||
| 229 | platform_device_register(&rtc_device); | ||
| 230 | #endif /* CONFIG_PNP */ | ||
| 231 | return 0; | ||
| 232 | } | ||
| 233 | device_initcall(add_rtc_cmos); | ||
