aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJacob Pan <jacob.jun.pan@linux.intel.com>2010-12-09 10:37:39 +0000
committerAlan Cox <alan@linux.intel.com>2010-12-09 10:37:39 +0000
commit7b58005274b195331dd4d57c069347fbc7e06d6c (patch)
tree47eae4aa3f1b52a705f92946a889270f646dd2b6 /drivers
parent1fff962cb0af23f837d0b87431df72373d2ac99c (diff)
downloadmrst-s0i3-test-7b58005274b195331dd4d57c069347fbc7e06d6c.tar.gz
mrst-s0i3-test-7b58005274b195331dd4d57c069347fbc7e06d6c.tar.xz
mrst-s0i3-test-7b58005274b195331dd4d57c069347fbc7e06d6c.zip
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. Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com> Signed-off-by: Alan Cox <alan@linux.intel.com>
Diffstat (limited to 'drivers')
-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 bcd0cf63eb1..28e02e7580f 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);