diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2009-03-25 06:00:08 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-03-25 06:00:08 -0400 |
commit | cf281a99b6e4f1223c8fdce390db3bf79e773f4c (patch) | |
tree | 33bff28362b5e41f7a2a09c097e0d2ea6e4ded13 /drivers | |
parent | fbf2b1f9cfdb4e4b5d042839142ed19ff5d46679 (diff) | |
parent | 9d1d4f9eabbca276a2a618a94ed3149d5971063e (diff) |
Merge git://git.marvell.com/orion into devel
Diffstat (limited to 'drivers')
-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 45f12dcd3716..e0263d2005ee 100644 --- a/drivers/rtc/rtc-mv.c +++ b/drivers/rtc/rtc-mv.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/bcd.h> | 12 | #include <linux/bcd.h> |
13 | #include <linux/io.h> | 13 | #include <linux/io.h> |
14 | #include <linux/platform_device.h> | 14 | #include <linux/platform_device.h> |
15 | #include <linux/delay.h> | ||
15 | 16 | ||
16 | 17 | ||
17 | #define RTC_TIME_REG_OFFS 0 | 18 | #define RTC_TIME_REG_OFFS 0 |
@@ -119,6 +120,16 @@ static int __init mv_rtc_probe(struct platform_device *pdev) | |||
119 | return -EINVAL; | 120 | return -EINVAL; |
120 | } | 121 | } |
121 | 122 | ||
123 | /* make sure it is actually functional */ | ||
124 | if (rtc_time == 0x01000000) { | ||
125 | ssleep(1); | ||
126 | rtc_time = readl(pdata->ioaddr + RTC_TIME_REG_OFFS); | ||
127 | if (rtc_time == 0x01000000) { | ||
128 | dev_err(&pdev->dev, "internal RTC not ticking\n"); | ||
129 | return -ENODEV; | ||
130 | } | ||
131 | } | ||
132 | |||
122 | platform_set_drvdata(pdev, pdata); | 133 | platform_set_drvdata(pdev, pdata); |
123 | pdata->rtc = rtc_device_register(pdev->name, &pdev->dev, | 134 | pdata->rtc = rtc_device_register(pdev->name, &pdev->dev, |
124 | &mv_rtc_ops, THIS_MODULE); | 135 | &mv_rtc_ops, THIS_MODULE); |