diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2009-03-25 10:00:08 (GMT) |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-03-25 10:00:08 (GMT) |
commit | cf281a99b6e4f1223c8fdce390db3bf79e773f4c (patch) | |
tree | 33bff28362b5e41f7a2a09c097e0d2ea6e4ded13 /drivers/rtc | |
parent | fbf2b1f9cfdb4e4b5d042839142ed19ff5d46679 (diff) | |
parent | 9d1d4f9eabbca276a2a618a94ed3149d5971063e (diff) | |
download | linux-cf281a99b6e4f1223c8fdce390db3bf79e773f4c.tar.xz |
Merge git://git.marvell.com/orion into devel
Diffstat (limited to 'drivers/rtc')
-rw-r--r-- | drivers/rtc/rtc-mv.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/rtc/rtc-mv.c b/drivers/rtc/rtc-mv.c index 45f12dc..e0263d2 100644 --- a/drivers/rtc/rtc-mv.c +++ b/drivers/rtc/rtc-mv.c @@ -12,6 +12,7 @@ #include <linux/bcd.h> #include <linux/io.h> #include <linux/platform_device.h> +#include <linux/delay.h> #define RTC_TIME_REG_OFFS 0 @@ -119,6 +120,16 @@ static int __init mv_rtc_probe(struct platform_device *pdev) return -EINVAL; } + /* make sure it is actually functional */ + if (rtc_time == 0x01000000) { + ssleep(1); + rtc_time = readl(pdata->ioaddr + RTC_TIME_REG_OFFS); + if (rtc_time == 0x01000000) { + dev_err(&pdev->dev, "internal RTC not ticking\n"); + return -ENODEV; + } + } + platform_set_drvdata(pdev, pdata); pdata->rtc = rtc_device_register(pdev->name, &pdev->dev, &mv_rtc_ops, THIS_MODULE); |