Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-or-later
0002 /*
0003  *  DEC platform devices.
0004  *
0005  *  Copyright (c) 2014  Maciej W. Rozycki
0006  */
0007 
0008 #include <linux/ioport.h>
0009 #include <linux/kernel.h>
0010 #include <linux/mc146818rtc.h>
0011 #include <linux/platform_device.h>
0012 
0013 static struct resource dec_rtc_resources[] = {
0014     {
0015         .name = "rtc",
0016         .flags = IORESOURCE_MEM,
0017     },
0018 };
0019 
0020 static struct cmos_rtc_board_info dec_rtc_info = {
0021     .flags = CMOS_RTC_FLAGS_NOFREQ,
0022     .address_space = 64,
0023 };
0024 
0025 static struct platform_device dec_rtc_device = {
0026     .name = "rtc_cmos",
0027     .id = PLATFORM_DEVID_NONE,
0028     .dev.platform_data = &dec_rtc_info,
0029     .resource = dec_rtc_resources,
0030     .num_resources = ARRAY_SIZE(dec_rtc_resources),
0031 };
0032 
0033 static int __init dec_add_devices(void)
0034 {
0035     dec_rtc_resources[0].start = RTC_PORT(0);
0036     dec_rtc_resources[0].end = RTC_PORT(0) + dec_kn_slot_size - 1;
0037     return platform_device_register(&dec_rtc_device);
0038 }
0039 
0040 device_initcall(dec_add_devices);