aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc
diff options
context:
space:
mode:
authorMark Salter <msalter@redhat.com>2014-08-08 17:20:14 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-08-08 18:57:19 -0400
commitda167ad7638759adb811afa3c80ff4cb67608242 (patch)
tree8182f1ec3355c25918ed38c8d03c6b541cba26c9 /drivers/rtc
parentca6dc2dab97133b874c2f6a76b6125497b67b429 (diff)
rtc: ia64: allow other architectures to use EFI RTC
Currently, the rtc-efi driver is restricted to ia64 only. Newer architectures with EFI support may want to also use that driver. This patch moves the platform device setup from ia64 into drivers/rtc and allow any architecture with CONFIG_EFI=y to use the rtc-efi driver. Signed-off-by: Mark Salter <msalter@redhat.com> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: Tony Luck <tony.luck@intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/Kconfig2
-rw-r--r--drivers/rtc/Makefile4
-rw-r--r--drivers/rtc/rtc-efi-platform.c31
3 files changed, 36 insertions, 1 deletions
diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
index a672dd16da62..83743a1a6731 100644
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -798,7 +798,7 @@ config RTC_DRV_DA9063
798 798
799config RTC_DRV_EFI 799config RTC_DRV_EFI
800 tristate "EFI RTC" 800 tristate "EFI RTC"
801 depends on IA64 801 depends on EFI
802 help 802 help
803 If you say yes here you will get support for the EFI 803 If you say yes here you will get support for the EFI
804 Real Time Clock. 804 Real Time Clock.
diff --git a/drivers/rtc/Makefile b/drivers/rtc/Makefile
index 70347d041d10..f1dfc3648ee5 100644
--- a/drivers/rtc/Makefile
+++ b/drivers/rtc/Makefile
@@ -10,6 +10,10 @@ obj-$(CONFIG_RTC_SYSTOHC) += systohc.o
10obj-$(CONFIG_RTC_CLASS) += rtc-core.o 10obj-$(CONFIG_RTC_CLASS) += rtc-core.o
11rtc-core-y := class.o interface.o 11rtc-core-y := class.o interface.o
12 12
13ifdef CONFIG_RTC_DRV_EFI
14rtc-core-y += rtc-efi-platform.o
15endif
16
13rtc-core-$(CONFIG_RTC_INTF_DEV) += rtc-dev.o 17rtc-core-$(CONFIG_RTC_INTF_DEV) += rtc-dev.o
14rtc-core-$(CONFIG_RTC_INTF_PROC) += rtc-proc.o 18rtc-core-$(CONFIG_RTC_INTF_PROC) += rtc-proc.o
15rtc-core-$(CONFIG_RTC_INTF_SYSFS) += rtc-sysfs.o 19rtc-core-$(CONFIG_RTC_INTF_SYSFS) += rtc-sysfs.o
diff --git a/drivers/rtc/rtc-efi-platform.c b/drivers/rtc/rtc-efi-platform.c
new file mode 100644
index 000000000000..b40fbe332af4
--- /dev/null
+++ b/drivers/rtc/rtc-efi-platform.c
@@ -0,0 +1,31 @@
1/*
2 * Moved from arch/ia64/kernel/time.c
3 *
4 * Copyright (C) 1998-2003 Hewlett-Packard Co
5 * Stephane Eranian <eranian@hpl.hp.com>
6 * David Mosberger <davidm@hpl.hp.com>
7 * Copyright (C) 1999 Don Dugger <don.dugger@intel.com>
8 * Copyright (C) 1999-2000 VA Linux Systems
9 * Copyright (C) 1999-2000 Walt Drummond <drummond@valinux.com>
10 */
11#include <linux/init.h>
12#include <linux/kernel.h>
13#include <linux/module.h>
14#include <linux/efi.h>
15#include <linux/platform_device.h>
16
17static struct platform_device rtc_efi_dev = {
18 .name = "rtc-efi",
19 .id = -1,
20};
21
22static int __init rtc_init(void)
23{
24 if (efi_enabled(EFI_RUNTIME_SERVICES))
25 if (platform_device_register(&rtc_efi_dev) < 0)
26 pr_err("unable to register rtc device...\n");
27
28 /* not necessarily an error */
29 return 0;
30}
31module_init(rtc_init);