#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>
unsigned long flags;
u8 csr;
+ pm_runtime_get_sync(wdt->dev);
+
spin_lock_irqsave(&wdt->lock, flags);
next_heartbeat = jiffies + (heartbeat * HZ);
spin_unlock_irqrestore(&wdt->lock, flags);
+ pm_runtime_put_sync(wdt->dev);
+
return 0;
}
dev_info(&pdev->dev, "initialized.\n");
+ pm_runtime_enable(&pdev->dev);
+
return 0;
out_disable:
watchdog_unregister_device(&sh_wdt_dev);
+ pm_runtime_disable(&pdev->dev);
clk_disable(wdt->clk);
clk_put(wdt->clk);