aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-mrst.c
diff options
context:
space:
mode:
authorFeng Tang <feng.tang@intel.com>2011-02-15 00:13:32 +0800
committerThomas Gleixner <tglx@linutronix.de>2011-02-14 18:20:43 +0100
commit168202c7bf89d7a2abaf8deaf4bbed18a1f7b3a3 (patch)
tree7be510d8fcbc1c68582d1b3a64971e8a59e3d798 /drivers/rtc/rtc-mrst.c
parent6b617e224dfac0b64ed70dacdac50be6eb78a6a1 (diff)
downloadkernel_goldelico_gta04-168202c7bf89d7a2abaf8deaf4bbed18a1f7b3a3.zip
kernel_goldelico_gta04-168202c7bf89d7a2abaf8deaf4bbed18a1f7b3a3.tar.gz
kernel_goldelico_gta04-168202c7bf89d7a2abaf8deaf4bbed18a1f7b3a3.tar.bz2
mrst/vrtc: Avoid using cmos rtc ops
If we don't assign Moorestown specific wallclock init and ops function the rtc/persisent clock code will use cmos rtc for access, this will crash Moorestown in that the ioports are not present. Also in vrtc driver, should avoid using cmos access to check UIP status. [feng.tang@intel.com: use set_fixmap_offset_nocache() to simplify code] Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com> Signed-off-by: Feng Tang <feng.tang@intel.com> Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'drivers/rtc/rtc-mrst.c')
-rw-r--r--drivers/rtc/rtc-mrst.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/rtc/rtc-mrst.c b/drivers/rtc/rtc-mrst.c
index bcd0cf6..28e02e7 100644
--- a/drivers/rtc/rtc-mrst.c
+++ b/drivers/rtc/rtc-mrst.c
@@ -62,6 +62,17 @@ static inline int is_intr(u8 rtc_intr)
return rtc_intr & RTC_IRQMASK;
}
+static inline unsigned char vrtc_is_updating(void)
+{
+ unsigned char uip;
+ unsigned long flags;
+
+ spin_lock_irqsave(&rtc_lock, flags);
+ uip = (vrtc_cmos_read(RTC_FREQ_SELECT) & RTC_UIP);
+ spin_unlock_irqrestore(&rtc_lock, flags);
+ return uip;
+}
+
/*
* rtc_time's year contains the increment over 1900, but vRTC's YEAR
* register can't be programmed to value larger than 0x64, so vRTC
@@ -76,7 +87,7 @@ static int mrst_read_time(struct device *dev, struct rtc_time *time)
{
unsigned long flags;
- if (rtc_is_updating())
+ if (vrtc_is_updating())
mdelay(20);
spin_lock_irqsave(&rtc_lock, flags);