diff options
author | Paul Mundt <lethal@linux-sh.org> | 2012-05-10 09:08:35 +0200 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2012-05-10 09:08:35 +0200 |
commit | 8c013d964ac32c20afe2cdeadf59926d87012b37 (patch) | |
tree | a20f0d26d4c59ed86970a8954e93e36fa55a399c /drivers/watchdog/shwdt.c | |
parent | watchdog: shwdt: Basic clock framework support. (diff) | |
download | linux-8c013d964ac32c20afe2cdeadf59926d87012b37.tar.xz linux-8c013d964ac32c20afe2cdeadf59926d87012b37.zip |
watchdog: shwdt: Preliminary runtime PM support.
This plugs in some trivial runtime PM support in the probe/remove and
start/stop paths.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers/watchdog/shwdt.c')
-rw-r--r-- | drivers/watchdog/shwdt.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/watchdog/shwdt.c b/drivers/watchdog/shwdt.c index 380ada4e5d66..b11104702d23 100644 --- a/drivers/watchdog/shwdt.c +++ b/drivers/watchdog/shwdt.c @@ -28,6 +28,7 @@ #include <linux/spinlock.h> #include <linux/miscdevice.h> #include <linux/watchdog.h> +#include <linux/pm_runtime.h> #include <linux/fs.h> #include <linux/mm.h> #include <linux/slab.h> @@ -87,6 +88,8 @@ static int sh_wdt_start(struct watchdog_device *wdt_dev) unsigned long flags; u8 csr; + pm_runtime_get_sync(wdt->dev); + spin_lock_irqsave(&wdt->lock, flags); next_heartbeat = jiffies + (heartbeat * HZ); @@ -137,6 +140,8 @@ static int sh_wdt_stop(struct watchdog_device *wdt_dev) spin_unlock_irqrestore(&wdt->lock, flags); + pm_runtime_put_sync(wdt->dev); + return 0; } @@ -283,6 +288,8 @@ static int __devinit sh_wdt_probe(struct platform_device *pdev) dev_info(&pdev->dev, "initialized.\n"); + pm_runtime_enable(&pdev->dev); + return 0; out_disable: @@ -300,6 +307,7 @@ static int __devexit sh_wdt_remove(struct platform_device *pdev) watchdog_unregister_device(&sh_wdt_dev); + pm_runtime_disable(&pdev->dev); clk_disable(wdt->clk); clk_put(wdt->clk); |