aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaxman Dewangan <ldewangan@nvidia.com>2013-02-21 19:44:36 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-21 20:22:28 -0500
commitdfaf09ac8555141b7311bb69b456bd96886fd90c (patch)
treebe5f3f97462475fdf38aa26e0aa8bf8141731581
parenteb5eba4ef72248b976465906cfed5fca2e9d8831 (diff)
drivers/rtc/rtc-tps65910.c: remove unnecessary irq stat save and restore
The driver stores the interrupt enable register before going to suspend and restore in resume. Also it enables alarm before going to suspend. The driver only write the Interrupt enable register for enabling ALARM and does not enable any other bits. So it is not require to save complete register and enable ALARM interrupt before suspend and restore in resume. Also ALARM interrupt already enable if alarm is enabled before going to suspend and hence it is not require to enable explictly in suspend. Removing such above code. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Cc: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/rtc/rtc-tps65910.c21
1 files changed, 2 insertions, 19 deletions
diff --git a/drivers/rtc/rtc-tps65910.c b/drivers/rtc/rtc-tps65910.c
index 932a655aa41c..7ef42c25358c 100644
--- a/drivers/rtc/rtc-tps65910.c
+++ b/drivers/rtc/rtc-tps65910.c
@@ -28,8 +28,6 @@
28struct tps65910_rtc { 28struct tps65910_rtc {
29 struct rtc_device *rtc; 29 struct rtc_device *rtc;
30 int irq; 30 int irq;
31 /* To store the list of enabled interrupts */
32 u32 irqstat;
33}; 31};
34 32
35/* Total number of RTC registers needed to set time*/ 33/* Total number of RTC registers needed to set time*/
@@ -309,35 +307,20 @@ static int tps65910_rtc_remove(struct platform_device *pdev)
309 307
310static int tps65910_rtc_suspend(struct device *dev) 308static int tps65910_rtc_suspend(struct device *dev)
311{ 309{
312 struct tps65910 *tps = dev_get_drvdata(dev->parent);
313 struct tps65910_rtc *tps_rtc = dev_get_drvdata(dev); 310 struct tps65910_rtc *tps_rtc = dev_get_drvdata(dev);
314 u8 alarm = TPS65910_RTC_INTERRUPTS_IT_ALARM;
315 int ret;
316 311
317 if (device_may_wakeup(dev)) 312 if (device_may_wakeup(dev))
318 enable_irq_wake(tps_rtc->irq); 313 enable_irq_wake(tps_rtc->irq);
319 314 return 0;
320 /* Store current list of enabled interrupts*/
321 ret = regmap_read(tps->regmap, TPS65910_RTC_INTERRUPTS,
322 &tps->rtc->irqstat);
323 if (ret < 0)
324 return ret;
325
326 /* Enable RTC ALARM interrupt only */
327 return regmap_write(tps->regmap, TPS65910_RTC_INTERRUPTS, alarm);
328} 315}
329 316
330static int tps65910_rtc_resume(struct device *dev) 317static int tps65910_rtc_resume(struct device *dev)
331{ 318{
332 struct tps65910 *tps = dev_get_drvdata(dev->parent);
333 struct tps65910_rtc *tps_rtc = dev_get_drvdata(dev); 319 struct tps65910_rtc *tps_rtc = dev_get_drvdata(dev);
334 320
335 if (device_may_wakeup(dev)) 321 if (device_may_wakeup(dev))
336 disable_irq_wake(tps_rtc->irq); 322 disable_irq_wake(tps_rtc->irq);
337 323 return 0;
338 /* Restore list of enabled interrupts before suspend */
339 return regmap_write(tps->regmap, TPS65910_RTC_INTERRUPTS,
340 tps->rtc->irqstat);
341} 324}
342 325
343static const struct dev_pm_ops tps65910_rtc_pm_ops = { 326static const struct dev_pm_ops tps65910_rtc_pm_ops = {