diff options
author | Lily Zhang <r58066@freescale.com> | 2009-10-11 18:00:16 +0800 |
---|---|---|
committer | Lily Zhang <r58066@freescale.com> | 2009-10-14 20:28:24 +0800 |
commit | 31e7b8f7a93d913f9338b8847c134e1f18008227 (patch) | |
tree | 0a4d6fb19bff82bb41b5923a6abf6fe13ae1d7f9 | |
parent | 848f1b0613d4bd8cd575911835ed71efbd9a5315 (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>
-rw-r--r-- | drivers/rtc/rtc-mxc_v2.c | 35 |
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; } |