diff options
author | Maciej W. Rozycki <macro@linux-mips.org> | 2014-06-06 17:35:50 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-06 19:08:07 -0400 |
commit | fae67ad431146d2584dd813cbc198400a477aa53 (patch) | |
tree | 4fe2019d3f1f2711787761f88a5cdf0d43e556c9 | |
parent | 31632dbdba85aafc8a6772d578c5c14f84a1fe17 (diff) |
arch/mips/dec: switch DECstation systems to rtc-cmos
This adds an RTC platform device for DECstation systems so that they can
use the rtc-cmos driver for their RTC device.
Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | arch/mips/dec/Makefile | 2 | ||||
-rw-r--r-- | arch/mips/dec/platform.c | 44 |
2 files changed, 45 insertions, 1 deletions
diff --git a/arch/mips/dec/Makefile b/arch/mips/dec/Makefile index 3d5d2c56de8d..bd74e05c90b0 100644 --- a/arch/mips/dec/Makefile +++ b/arch/mips/dec/Makefile | |||
@@ -3,7 +3,7 @@ | |||
3 | # | 3 | # |
4 | 4 | ||
5 | obj-y := ecc-berr.o int-handler.o ioasic-irq.o kn01-berr.o \ | 5 | obj-y := ecc-berr.o int-handler.o ioasic-irq.o kn01-berr.o \ |
6 | kn02-irq.o kn02xa-berr.o reset.o setup.o time.o | 6 | kn02-irq.o kn02xa-berr.o platform.o reset.o setup.o time.o |
7 | 7 | ||
8 | obj-$(CONFIG_TC) += tc.o | 8 | obj-$(CONFIG_TC) += tc.o |
9 | obj-$(CONFIG_CPU_HAS_WB) += wbflush.o | 9 | obj-$(CONFIG_CPU_HAS_WB) += wbflush.o |
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 @@ | |||
1 | /* | ||
2 | * DEC platform devices. | ||
3 | * | ||
4 | * Copyright (c) 2014 Maciej W. Rozycki | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License | ||
8 | * as published by the Free Software Foundation; either version | ||
9 | * 2 of the License, or (at your option) any later version. | ||
10 | */ | ||
11 | |||
12 | #include <linux/ioport.h> | ||
13 | #include <linux/kernel.h> | ||
14 | #include <linux/mc146818rtc.h> | ||
15 | #include <linux/platform_device.h> | ||
16 | |||
17 | static struct resource dec_rtc_resources[] = { | ||
18 | { | ||
19 | .name = "rtc", | ||
20 | .flags = IORESOURCE_MEM, | ||
21 | }, | ||
22 | }; | ||
23 | |||
24 | static struct cmos_rtc_board_info dec_rtc_info = { | ||
25 | .flags = CMOS_RTC_FLAGS_NOFREQ, | ||
26 | .address_space = 64, | ||
27 | }; | ||
28 | |||
29 | static struct platform_device dec_rtc_device = { | ||
30 | .name = "rtc_cmos", | ||
31 | .id = PLATFORM_DEVID_NONE, | ||
32 | .dev.platform_data = &dec_rtc_info, | ||
33 | .resource = dec_rtc_resources, | ||
34 | .num_resources = ARRAY_SIZE(dec_rtc_resources), | ||
35 | }; | ||
36 | |||
37 | static int __init dec_add_devices(void) | ||
38 | { | ||
39 | dec_rtc_resources[0].start = RTC_PORT(0); | ||
40 | dec_rtc_resources[0].end = RTC_PORT(0) + dec_kn_slot_size - 1; | ||
41 | return platform_device_register(&dec_rtc_device); | ||
42 | } | ||
43 | |||
44 | device_initcall(dec_add_devices); | ||