linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Allow sharing of CMOS clock setup.
@ 2007-10-26 17:45 Randy Vinson
  0 siblings, 0 replies; only message in thread
From: Randy Vinson @ 2007-10-26 17:45 UTC (permalink / raw)
  To: linuxppc-dev@ozlabs.org, kumar Gala

>From 61da8cf1f92043925ea20ffafafaf0874d761b0e Mon Sep 17 00:00:00 2001
From: Randy Vinson <rvinson@mvista.com>
Date: Wed, 24 Oct 2007 17:36:59 -0700
Subject: [PATCH] Allow sharing of CMOS clock setup.

Move the CMOS RTC clock setup code from arch/powerpc/platforms/fsl_uli1575.c
to arch/powerpc/sysdev/rtc_cmos_setup.c so it can be used by more platforms.

Signed-off-by: Randy Vinson <rvinson@mvista.com>
---
 arch/powerpc/platforms/fsl_uli1575.c |   14 --------------
 arch/powerpc/sysdev/rtc_cmos_setup.c |   13 +++++++++++++
 2 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/arch/powerpc/platforms/fsl_uli1575.c b/arch/powerpc/platforms/fsl_uli1575.c
index afc9141..171d04f 100644
--- a/arch/powerpc/platforms/fsl_uli1575.c
+++ b/arch/powerpc/platforms/fsl_uli1575.c
@@ -13,7 +13,6 @@
 #include <linux/kernel.h>
 #include <linux/pci.h>
 #include <linux/interrupt.h>
-#include <linux/mc146818rtc.h>
 
 #include <asm/system.h>
 #include <asm/pci-bridge.h>
@@ -155,19 +154,6 @@ static void __devinit quirk_final_uli1575(struct pci_dev *dev)
 
 	outb(0xfa, 0x4d0);
 	outb(0x1e, 0x4d1);
-
-	/* setup RTC */
-	CMOS_WRITE(RTC_SET, RTC_CONTROL);
-	CMOS_WRITE(RTC_24H, RTC_CONTROL);
-
-	/* ensure month, date, and week alarm fields are ignored */
-	CMOS_WRITE(0, RTC_VALID);
-
-	outb_p(0x7c, 0x72);
-	outb_p(RTC_ALARM_DONT_CARE, 0x73);
-
-	outb_p(0x7d, 0x72);
-	outb_p(RTC_ALARM_DONT_CARE, 0x73);
 }
 
 /* SATA */
diff --git a/arch/powerpc/sysdev/rtc_cmos_setup.c b/arch/powerpc/sysdev/rtc_cmos_setup.c
index 0c9ac7e..4779b0b 100644
--- a/arch/powerpc/sysdev/rtc_cmos_setup.c
+++ b/arch/powerpc/sysdev/rtc_cmos_setup.c
@@ -53,6 +53,19 @@ static int  __init add_rtc(void)
 	if (IS_ERR(pd))
 		return PTR_ERR(pd);
 
+	/* setup RTC */
+	CMOS_WRITE(RTC_SET, RTC_CONTROL);
+	CMOS_WRITE(RTC_24H, RTC_CONTROL);
+
+	/* ensure month, date, and week alarm fields are ignored */
+	CMOS_WRITE(0, RTC_VALID);
+
+	outb_p(0x7c, 0x72);
+	outb_p(RTC_ALARM_DONT_CARE, 0x73);
+
+	outb_p(0x7d, 0x72);
+	outb_p(RTC_ALARM_DONT_CARE, 0x73);
+
 	return 0;
 }
 fs_initcall(add_rtc);
-- 
1.5.3.rc2.22.g69a9b

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2007-10-26 18:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-26 17:45 [PATCH] Allow sharing of CMOS clock setup Randy Vinson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).