All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] rtc-efi: register rtc-efi device when EFI enabled
@ 2012-12-28 16:26 ` Lee, Chun-Yi
  0 siblings, 0 replies; 38+ messages in thread
From: Lee, Chun-Yi @ 2012-12-28 16:26 UTC (permalink / raw)
  To: matt.fleming-ral2JQCrhuEAvxtiuMwx3w
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-efi-u79uwXL29TY76Z2rM5mHXA, Lee, Chun-Yi, H. Peter Anvin,
	Matthew Garrett, Thomas Gleixner, Ingo Molnar, Jan Beulich

UEFI time services, GetTime(), SetTime(), GetWakeupTime(), SetWakeupTime() are also
supported by other non-IA64 architecutre with UEFI BIOS, e.g. x86.

This patch changed RTC_DRV_EFI configuration to depend on EFI but not just IA64. It
checks efi_enabled flag and efi-rtc driver should enabled.

Cc: Matt Fleming <matt.fleming-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: H. Peter Anvin <hpa-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
Cc: Matthew Garrett <matthew.garrett-05XSO3Yj/JvQT0dZR+AlfA@public.gmane.org>
Cc: Thomas Gleixner <tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
Cc: Ingo Molnar <mingo-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: Jan Beulich <JBeulich-IBi9RG/b67k@public.gmane.org>
Signed-off-by: Lee, Chun-Yi <jlee-IBi9RG/b67k@public.gmane.org>
---
 arch/x86/platform/efi/efi.c |   20 ++++++++++++++++++++
 drivers/rtc/Kconfig         |    2 +-
 2 files changed, 21 insertions(+), 1 deletions(-)

diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
index ad44391..f08d28b 100644
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -41,6 +41,9 @@
 #include <linux/io.h>
 #include <linux/reboot.h>
 #include <linux/bcd.h>
+#if (defined CONFIG_RTC_DRV_EFI || defined CONFIG_RTC_DRV_EFI_MODULE)
+#include <linux/platform_device.h>
+#endif
 
 #include <asm/setup.h>
 #include <asm/efi.h>
@@ -961,6 +964,23 @@ void __init efi_enter_virtual_mode(void)
 	kfree(new_memmap);
 }
 
+#if (defined CONFIG_RTC_DRV_EFI || defined CONFIG_RTC_DRV_EFI_MODULE)
+static struct platform_device rtc_efi_dev = {
+	.name = "rtc-efi",
+	.id = -1,
+};
+
+static int __init rtc_init(void)
+{
+	if (efi_enabled && platform_device_register(&rtc_efi_dev) < 0)
+		pr_err("unable to register rtc-efi device...\n");
+
+	/* not necessarily an error */
+	return 0;
+}
+arch_initcall(rtc_init);
+#endif
+
 /*
  * Convenience functions to obtain memory types and attributes
  */
diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
index d0cea02..7796f0a 100644
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -621,7 +621,7 @@ config RTC_DRV_DA9055
 
 config RTC_DRV_EFI
 	tristate "EFI RTC"
-	depends on IA64
+	depends on EFI
 	help
 	  If you say yes here you will get support for the EFI
 	  Real Time Clock.
-- 
1.6.4.2

^ permalink raw reply related	[flat|nested] 38+ messages in thread

end of thread, other threads:[~2013-01-09  6:28 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-28 16:26 [PATCH 1/3] rtc-efi: register rtc-efi device when EFI enabled Lee, Chun-Yi
2012-12-28 16:26 ` Lee, Chun-Yi
     [not found] ` <1356712001-12198-1-git-send-email-jlee-IBi9RG/b67k@public.gmane.org>
2012-12-28 16:26   ` [PATCH 2/3] rtc-efi: add timezone to rtc_time that will used by rtc-efi Lee, Chun-Yi
2012-12-28 16:26     ` Lee, Chun-Yi
2012-12-28 16:26   ` [PATCH 3/3] rtc-efi: set uie_unsupported for indicate rtc-efi doesn't support UIE mode Lee, Chun-Yi
2012-12-28 16:26     ` Lee, Chun-Yi
2012-12-28 17:43 ` [PATCH 1/3] rtc-efi: register rtc-efi device when EFI enabled Matthew Garrett
2012-12-28 17:43   ` Matthew Garrett
     [not found]   ` <E99CBA9F97C3D149AA6B19ED2E277C9B019215CC-kSjp6dTd0Hr1oIOzUjSfqB1/qY2kGW66nBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2012-12-28 19:07     ` H. Peter Anvin
2012-12-28 19:07       ` H. Peter Anvin
2012-12-28 19:17       ` Matthew Garrett
2012-12-28 19:17         ` Matthew Garrett
     [not found]         ` <E99CBA9F97C3D149AA6B19ED2E277C9B019215FA-kSjp6dTd0Hr1oIOzUjSfqB1/qY2kGW66nBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2012-12-28 20:40           ` H. Peter Anvin
2012-12-28 20:40             ` H. Peter Anvin
     [not found]             ` <50DE03D8.9030902-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
2012-12-28 20:49               ` Matthew Garrett
2012-12-28 20:49                 ` Matthew Garrett
     [not found]                 ` <35da3df5-ecac-4b57-83a2-828326e5bfc3@email.android.com>
     [not found]                   ` <35da3df5-ecac-4b57-83a2-828326e5bfc3-2ueSQiBKiTY7tOexoI0I+QC/G2K4zDHf@public.gmane.org>
2012-12-28 23:39                     ` Matthew Garrett
2012-12-28 23:39                       ` Matthew Garrett
2012-12-29  0:42                       ` H. Peter Anvin
     [not found]                         ` <50DE3C8F.4000405-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
2012-12-29  4:37                           ` Matthew Garrett
2012-12-29  4:37                             ` Matthew Garrett
     [not found]                             ` <E99CBA9F97C3D149AA6B19ED2E277C9B01921744-kSjp6dTd0Hr1oIOzUjSfqB1/qY2kGW66nBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2012-12-29  5:19                               ` H. Peter Anvin
2012-12-29  5:19                                 ` H. Peter Anvin
     [not found]                                 ` <ed3971f1-8464-4406-bae2-eff914c9c2fc-2ueSQiBKiTY7tOexoI0I+QC/G2K4zDHf@public.gmane.org>
2012-12-29  6:17                                   ` Matthew Garrett
2012-12-29  6:17                                     ` Matthew Garrett
     [not found]                 ` <E99CBA9F97C3D149AA6B19ED2E277C9B01921638-kSjp6dTd0Hr1oIOzUjSfqB1/qY2kGW66nBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2012-12-28 23:44                   ` H. Peter Anvin
2012-12-28 23:44                     ` H. Peter Anvin
     [not found]                     ` <50DE2EED.9030608-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
2013-01-02  2:45                       ` joeyli
2013-01-02  2:45                         ` joeyli
     [not found]                         ` <1357094751.6113.253.camel-ONCj+Eqt86TasUa73XJKwA@public.gmane.org>
2013-01-02  7:26                           ` Matt Fleming
2013-01-02  7:26                             ` Matt Fleming
2012-12-29  1:00   ` joeyli
     [not found]     ` <1356742803.6113.245.camel-ONCj+Eqt86TasUa73XJKwA@public.gmane.org>
2012-12-29  1:07       ` H. Peter Anvin
2012-12-29  1:07         ` H. Peter Anvin
     [not found]         ` <50DE4259.7090409-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
2013-01-09  6:23           ` joeyli
2013-01-09  6:23             ` joeyli
     [not found]             ` <1357712591.6113.389.camel-ONCj+Eqt86TasUa73XJKwA@public.gmane.org>
2013-01-09  6:27               ` H. Peter Anvin
2013-01-09  6:27                 ` H. Peter Anvin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.