diff options
-rw-r--r-- | drivers/rtc/rtc-tps65910.c | 21 |
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 @@ | |||
28 | struct tps65910_rtc { | 28 | struct 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 | ||
310 | static int tps65910_rtc_suspend(struct device *dev) | 308 | static 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 | ||
330 | static int tps65910_rtc_resume(struct device *dev) | 317 | static 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 | ||
343 | static const struct dev_pm_ops tps65910_rtc_pm_ops = { | 326 | static const struct dev_pm_ops tps65910_rtc_pm_ops = { |