Commit 51d45d25 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Zhang Rui

thermal: rcar: add pm_runtime_xxx() support

Current rcar_thermal() didn't care about own power.
Without this patch, rcar_thermal doesn't work on APE6 board
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
parent 1dc20828
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <linux/io.h> #include <linux/io.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/reboot.h> #include <linux/reboot.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
...@@ -377,6 +378,9 @@ static int rcar_thermal_probe(struct platform_device *pdev) ...@@ -377,6 +378,9 @@ static int rcar_thermal_probe(struct platform_device *pdev)
spin_lock_init(&common->lock); spin_lock_init(&common->lock);
common->dev = dev; common->dev = dev;
pm_runtime_enable(dev);
pm_runtime_get_sync(dev);
irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
if (irq) { if (irq) {
int ret; int ret;
...@@ -465,12 +469,16 @@ static int rcar_thermal_probe(struct platform_device *pdev) ...@@ -465,12 +469,16 @@ static int rcar_thermal_probe(struct platform_device *pdev)
rcar_thermal_irq_disable(priv); rcar_thermal_irq_disable(priv);
} }
pm_runtime_put_sync(dev);
pm_runtime_disable(dev);
return ret; return ret;
} }
static int rcar_thermal_remove(struct platform_device *pdev) static int rcar_thermal_remove(struct platform_device *pdev)
{ {
struct rcar_thermal_common *common = platform_get_drvdata(pdev); struct rcar_thermal_common *common = platform_get_drvdata(pdev);
struct device *dev = &pdev->dev;
struct rcar_thermal_priv *priv; struct rcar_thermal_priv *priv;
rcar_thermal_for_each_priv(priv, common) { rcar_thermal_for_each_priv(priv, common) {
...@@ -481,6 +489,9 @@ static int rcar_thermal_remove(struct platform_device *pdev) ...@@ -481,6 +489,9 @@ static int rcar_thermal_remove(struct platform_device *pdev)
platform_set_drvdata(pdev, NULL); platform_set_drvdata(pdev, NULL);
pm_runtime_put_sync(dev);
pm_runtime_disable(dev);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment