linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Randy Vinson <rvinson@mvista.com>
To: "linuxppc-dev@ozlabs.org" <linuxppc-dev@ozlabs.org>,
	kumar Gala <galak@kernel.crashing.org>
Subject: [PATCH] Allow sharing of CMOS clock setup.
Date: Fri, 26 Oct 2007 10:45:49 -0700	[thread overview]
Message-ID: <472227CD.8080204@mvista.com> (raw)

>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

                 reply	other threads:[~2007-10-26 18:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=472227CD.8080204@mvista.com \
    --to=rvinson@mvista.com \
    --cc=galak@kernel.crashing.org \
    --cc=linuxppc-dev@ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).