Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 346431
b: refs/heads/master
c: fc9bd90
h: refs/heads/master
i:
  346429: ef625ce
  346427: ae4f2b8
  346423: aea9747
  346415: 765b59f
  346399: 431020f
  346367: 610e5ca
v: v3
  • Loading branch information
Vaibhav Hiremath authored and Linus Torvalds committed Dec 18, 2012
1 parent f8c4669 commit ef62097
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 427af9a6216b5845d428f27111add5311c381797
refs/heads/master: fc9bd9022e8d5863f3efce34cc38cb0c6187271c
18 changes: 18 additions & 0 deletions trunk/drivers/rtc/rtc-omap.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <linux/platform_device.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/pm_runtime.h>

#include <asm/io.h>

Expand Down Expand Up @@ -364,6 +365,10 @@ static int __init omap_rtc_probe(struct platform_device *pdev)
goto fail;
}

/* Enable the clock/module so that we can access the registers */
pm_runtime_enable(&pdev->dev);
pm_runtime_get_sync(&pdev->dev);

id_entry = platform_get_device_id(pdev);
if (id_entry && (id_entry->driver_data & OMAP_RTC_HAS_KICKER)) {
rtc_writel(KICK0_VALUE, OMAP_RTC_KICK0_REG);
Expand Down Expand Up @@ -448,6 +453,8 @@ static int __init omap_rtc_probe(struct platform_device *pdev)
fail0:
if (id_entry && (id_entry->driver_data & OMAP_RTC_HAS_KICKER))
rtc_writel(0, OMAP_RTC_KICK0_REG);
pm_runtime_put_sync(&pdev->dev);
pm_runtime_disable(&pdev->dev);
iounmap(rtc_base);
fail:
release_mem_region(mem->start, resource_size(mem));
Expand All @@ -474,6 +481,11 @@ static int __exit omap_rtc_remove(struct platform_device *pdev)
rtc_device_unregister(rtc);
if (id_entry && (id_entry->driver_data & OMAP_RTC_HAS_KICKER))
rtc_writel(0, OMAP_RTC_KICK0_REG);

/* Disable the clock/module */
pm_runtime_put_sync(&pdev->dev);
pm_runtime_disable(&pdev->dev);

iounmap(rtc_base);
release_mem_region(mem->start, resource_size(mem));
return 0;
Expand All @@ -496,11 +508,17 @@ static int omap_rtc_suspend(struct platform_device *pdev, pm_message_t state)
else
rtc_write(0, OMAP_RTC_INTERRUPTS_REG);

/* Disable the clock/module */
pm_runtime_put_sync(&pdev->dev);

return 0;
}

static int omap_rtc_resume(struct platform_device *pdev)
{
/* Enable the clock/module so that we can access the registers */
pm_runtime_get_sync(&pdev->dev);

if (device_may_wakeup(&pdev->dev))
disable_irq_wake(omap_rtc_alarm);
else
Expand Down

0 comments on commit ef62097

Please sign in to comment.