diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2014-04-23 13:48:20 +1000 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2014-04-23 13:48:20 +1000 |
commit | ec2e3208e69f09bb993b106e7a0698997254d299 (patch) | |
tree | ee3a109dfa2065e72b116a679ade30d1578410fc /arch/mips/dec/platform.c | |
parent | d9cf7ff88de666072bbfc7c18ce979be8114cc82 (diff) | |
parent | 7f6706aa1af1675f13e964b48d98ba69b41b7d73 (diff) |
Merge branch 'akpm-current/current'
Diffstat (limited to 'arch/mips/dec/platform.c')
-rw-r--r-- | arch/mips/dec/platform.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/arch/mips/dec/platform.c b/arch/mips/dec/platform.c new file mode 100644 index 000000000000..c7ac86af847a --- /dev/null +++ b/arch/mips/dec/platform.c @@ -0,0 +1,44 @@ +/* + * DEC platform devices. + * + * Copyright (c) 2014 Maciej W. Rozycki + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + */ + +#include <linux/ioport.h> +#include <linux/kernel.h> +#include <linux/mc146818rtc.h> +#include <linux/platform_device.h> + +static struct resource dec_rtc_resources[] = { + { + .name = "rtc", + .flags = IORESOURCE_MEM, + }, +}; + +static struct cmos_rtc_board_info dec_rtc_info = { + .flags = CMOS_RTC_FLAGS_NOFREQ, + .address_space = 64, +}; + +static struct platform_device dec_rtc_device = { + .name = "rtc_cmos", + .id = PLATFORM_DEVID_NONE, + .dev.platform_data = &dec_rtc_info, + .resource = dec_rtc_resources, + .num_resources = ARRAY_SIZE(dec_rtc_resources), +}; + +static int __init dec_add_devices(void) +{ + dec_rtc_resources[0].start = RTC_PORT(0); + dec_rtc_resources[0].end = RTC_PORT(0) + dec_kn_slot_size - 1; + return platform_device_register(&dec_rtc_device); +} + +device_initcall(dec_add_devices); |