Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 98069
b: refs/heads/master
c: 1da2e3d
h: refs/heads/master
i:
  98067: 9c85072
v: v3
  • Loading branch information
Stas Sergeev authored and Linus Torvalds committed Jun 13, 2008
1 parent 9c0c2db commit c50933d
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 643b52b9c0b4e959436b4b551ebf4060d06d5ae8
refs/heads/master: 1da2e3d679a8ea2d9e82040359a706da0bd3bef6
34 changes: 34 additions & 0 deletions trunk/arch/x86/kernel/rtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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);
31 changes: 16 additions & 15 deletions trunk/drivers/rtc/rtc-cmos.c
Original file line number Diff line number Diff line change
Expand Up @@ -905,19 +905,7 @@ static struct pnp_driver cmos_pnp_driver = {
.resume = cmos_pnp_resume,
};

static int __init cmos_init(void)
{
return pnp_register_driver(&cmos_pnp_driver);
}
module_init(cmos_init);

static void __exit cmos_exit(void)
{
pnp_unregister_driver(&cmos_pnp_driver);
}
module_exit(cmos_exit);

#else /* no PNP */
#endif /* CONFIG_PNP */

/*----------------------------------------------------------------*/

Expand Down Expand Up @@ -958,20 +946,33 @@ static struct platform_driver cmos_platform_driver = {

static int __init cmos_init(void)
{
#ifdef CONFIG_PNP
if (pnp_platform_devices)
return pnp_register_driver(&cmos_pnp_driver);
else
return platform_driver_probe(&cmos_platform_driver,
cmos_platform_probe);
#else
return platform_driver_probe(&cmos_platform_driver,
cmos_platform_probe);
#endif /* CONFIG_PNP */
}
module_init(cmos_init);

static void __exit cmos_exit(void)
{
#ifdef CONFIG_PNP
if (pnp_platform_devices)
pnp_unregister_driver(&cmos_pnp_driver);
else
platform_driver_unregister(&cmos_platform_driver);
#else
platform_driver_unregister(&cmos_platform_driver);
#endif /* CONFIG_PNP */
}
module_exit(cmos_exit);


#endif /* !PNP */

MODULE_AUTHOR("David Brownell");
MODULE_DESCRIPTION("Driver for PC-style 'CMOS' RTCs");
MODULE_LICENSE("GPL");

0 comments on commit c50933d

Please sign in to comment.