| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- #include<linux/module.h>
- #include<linux/init.h>
- #include <linux/platform_device.h>
- #include<linux/ioport.h>
- #if 0
- struct platform_device
- {
- const char * name;
- u32 id;
- struct device dev;
- u32 num_resources;
- struct resource * resource;
- };
- #endif
- static struct resource fs_rtc_resource[]={
- [0] ={
- .start =0x57000040,
- .end =0x57000044,
- .flags = IORESOURCE_MEM,
- },
- [1] ={
- .start =12, //0x57000070
- .end =19, //0x5700008c 18 17 16 15
- .flags = IORESOURCE_MEM,
- },
- };
- void rtc_release(struct device *dev)
- {
-
- }
- static struct platform_device fs_device_rtc = {
- .name ="fs2410-rtc",
- .id =-1,
- .resource =fs_rtc_resource,
- .num_resources = ARRAY_SIZE(fs_rtc_resource),
- .dev ={
- .release =rtc_release,
- },
- };
- static int __init fs2410_rtc_dev_init(void)
- {
- platform_device_register(&fs_device_rtc);
- return 0;
- }
- static void __exit fs2410_rtc_dev_exit(void)
- {
- platform_device_unregister(&fs_device_rtc);
- }
- module_init(fs2410_rtc_dev_init);
- module_exit(fs2410_rtc_dev_exit);
- MODULE_LICENSE("GPL");
|