Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-or-later
0002 /*
0003  *  Lemote Fuloong platform support
0004  *
0005  *  Copyright(c) 2010 Arnaud Patard <apatard@mandriva.com>
0006  */
0007 
0008 #include <linux/init.h>
0009 #include <linux/kernel.h>
0010 #include <linux/platform_device.h>
0011 #include <linux/mc146818rtc.h>
0012 
0013 static struct resource loongson_rtc_resources[] = {
0014     {
0015         .start  = RTC_PORT(0),
0016         .end    = RTC_PORT(1),
0017         .flags  = IORESOURCE_IO,
0018     }, {
0019         .start  = RTC_IRQ,
0020         .end    = RTC_IRQ,
0021         .flags  = IORESOURCE_IRQ,
0022     }
0023 };
0024 
0025 static struct platform_device loongson_rtc_device = {
0026     .name       = "rtc_cmos",
0027     .id     = -1,
0028     .resource   = loongson_rtc_resources,
0029     .num_resources  = ARRAY_SIZE(loongson_rtc_resources),
0030 };
0031 
0032 
0033 static int __init loongson_rtc_platform_init(void)
0034 {
0035     platform_device_register(&loongson_rtc_device);
0036     return 0;
0037 }
0038 
0039 device_initcall(loongson_rtc_platform_init);