diff options
| author | Jonathan Corbet <corbet@lwn.net> | 2008-07-14 15:29:34 -0600 |
|---|---|---|
| committer | Jonathan Corbet <corbet@lwn.net> | 2008-07-14 15:29:34 -0600 |
| commit | 2fceef397f9880b212a74c418290ce69e7ac00eb (patch) | |
| tree | d9cc09ab992825ef7fede4a688103503e3caf655 /arch/x86/kernel/rtc.c | |
| parent | feae1ef116ed381625d3731c5ae4f4ebcb3fa302 (diff) | |
| parent | bce7f793daec3e65ec5c5705d2457b81fe7b5725 (diff) | |
Merge commit 'v2.6.26' into bkl-removal
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 @@ #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); |
