diff mbox

[2/2] thermal: rcar: add pm_runtime_xxx() support

Message ID 8738vkqb8y.wl%kuninori.morimoto.gx@renesas.com (mailing list archive)
State Superseded, archived
Delegated to: Zhang Rui
Headers show

Commit Message

Kuninori Morimoto March 25, 2013, 5:50 a.m. UTC
Current rcar_thermal() didn't care about own power.
Without this patch, rcar_thermal doesn't work on APE6 board

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/thermal/rcar_thermal.c |   10 ++++++++++
 1 file changed, 10 insertions(+)
diff mbox

Patch

diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
index 359e943..c40404f 100644
--- a/drivers/thermal/rcar_thermal.c
+++ b/drivers/thermal/rcar_thermal.c
@@ -24,6 +24,7 @@ 
 #include <linux/io.h>
 #include <linux/module.h>
 #include <linux/platform_device.h>
+#include <linux/pm_runtime.h>
 #include <linux/reboot.h>
 #include <linux/slab.h>
 #include <linux/spinlock.h>
@@ -411,6 +412,9 @@  static int rcar_thermal_probe(struct platform_device *pdev)
 		idle = 0; /* polling delaye is not needed */
 	}
 
+	pm_runtime_enable(dev);
+	pm_runtime_get_sync(dev);
+
 	for (i = 0;; i++) {
 		res = platform_get_resource(pdev, IORESOURCE_MEM, mres++);
 		if (!res)
@@ -465,6 +469,9 @@  error_unregister:
 			rcar_thermal_irq_disable(priv);
 	}
 
+	pm_runtime_put_sync(dev);
+	pm_runtime_disable(dev);
+
 	return -ENODEV;
 }
 
@@ -481,6 +488,9 @@  static int rcar_thermal_remove(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, NULL);
 
+	pm_runtime_put_sync(dev);
+	pm_runtime_disable(dev);
+
 	return 0;
 }