summaryrefslogtreecommitdiff
path: root/drivers/rtc
diff options
context:
space:
mode:
authorLily Zhang <r58066@freescale.com>2009-10-11 18:00:16 +0800
committerAlejandro Gonzalez <alex.gonzalez@digi.com>2010-02-12 17:19:22 +0100
commit6bf0aed3157bb588451455fa38f51c40b8ad95fd (patch)
treea9a1b91c1c361ed169a8f0bd40cae5c5fd81b245 /drivers/rtc
parentcd859a372b441680ccc55ab4ad5ce14886c5a6f1 (diff)
ENGR00117168-2 Support to build SRTC driver as module
Remove system timer restore codes in suspend and resume operations since rtc class driver has done it. After removing these codes, srtc driver can be built as module Signed-off-by: Lily Zhang <r58066@freescale.com>
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-mxc_v2.c35
1 files changed, 0 insertions, 35 deletions
diff --git a/drivers/rtc/rtc-mxc_v2.c b/drivers/rtc/rtc-mxc_v2.c
index 459607d0d3a2..2e886cf2715c 100644
--- a/drivers/rtc/rtc-mxc_v2.c
+++ b/drivers/rtc/rtc-mxc_v2.c
@@ -495,9 +495,6 @@ static struct rtc_class_ops mxc_rtc_ops = {
};
/*! MXC RTC Power management control */
-
-static struct timespec mxc_rtc_delta;
-
static int mxc_rtc_probe(struct platform_device *pdev)
{
struct clk *clk;
@@ -645,27 +642,14 @@ static int __exit mxc_rtc_remove(struct platform_device *pdev)
static int mxc_rtc_suspend(struct platform_device *pdev, pm_message_t state)
{
struct rtc_drv_data *pdata = platform_get_drvdata(pdev);
- void __iomem *ioaddr = pdata->ioaddr;
- struct timespec tv;
- clk_enable(pdata->clk);
if (device_may_wakeup(&pdev->dev)) {
enable_irq_wake(pdata->irq);
} else {
- /* calculate time delta for suspend. RTC precision is
- 1 second; adjust delta for avg 1/2 sec err */
- tv.tv_nsec = NSEC_PER_SEC >> 1;
- tv.tv_sec = __raw_readl(ioaddr + SRTC_LPSCMR);
- set_normalized_timespec(&mxc_rtc_delta,
- xtime.tv_sec - tv.tv_sec,
- xtime.tv_nsec - tv.tv_nsec);
-
if (pdata->irq_enable)
disable_irq(pdata->irq);
}
- clk_disable(pdata->clk);
-
return 0;
}
@@ -681,33 +665,14 @@ static int mxc_rtc_suspend(struct platform_device *pdev, pm_message_t state)
static int mxc_rtc_resume(struct platform_device *pdev)
{
struct rtc_drv_data *pdata = platform_get_drvdata(pdev);
- void __iomem *ioaddr = pdata->ioaddr;
- struct timespec tv;
- struct timespec ts;
-
- clk_enable(pdata->clk);
if (device_may_wakeup(&pdev->dev)) {
disable_irq_wake(pdata->irq);
} else {
if (pdata->irq_enable)
enable_irq(pdata->irq);
-
- tv.tv_nsec = 0;
- tv.tv_sec = __raw_readl(ioaddr + SRTC_LPSCMR);
-
- /*
- * restore wall clock using delta against this RTC;
- * adjust again for avg 1/2 second RTC sampling error
- */
- set_normalized_timespec(&ts,
- tv.tv_sec + mxc_rtc_delta.tv_sec,
- (NSEC_PER_SEC >> 1) +
- mxc_rtc_delta.tv_nsec);
- do_settimeofday(&ts);
}
- clk_disable(pdata->clk);
return 0;
}