diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2013-03-26 02:08:52 -0400 |
---|---|---|
committer | Zhang Rui <rui.zhang@intel.com> | 2013-04-02 09:18:39 -0400 |
commit | 51d45d25948bdf7422958b92a2d91dc703b1a4cc (patch) | |
tree | 9b512acd2ca71538950913ed9af13d3579a3302d /drivers/thermal/rcar_thermal.c | |
parent | 1dc20828e674a781635286072bae909dc4e5c377 (diff) |
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: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Diffstat (limited to 'drivers/thermal/rcar_thermal.c')
-rw-r--r-- | drivers/thermal/rcar_thermal.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c index 4d6095b9f9df..8d7edd4c8228 100644 --- a/drivers/thermal/rcar_thermal.c +++ b/drivers/thermal/rcar_thermal.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/io.h> | 24 | #include <linux/io.h> |
25 | #include <linux/module.h> | 25 | #include <linux/module.h> |
26 | #include <linux/platform_device.h> | 26 | #include <linux/platform_device.h> |
27 | #include <linux/pm_runtime.h> | ||
27 | #include <linux/reboot.h> | 28 | #include <linux/reboot.h> |
28 | #include <linux/slab.h> | 29 | #include <linux/slab.h> |
29 | #include <linux/spinlock.h> | 30 | #include <linux/spinlock.h> |
@@ -377,6 +378,9 @@ static int rcar_thermal_probe(struct platform_device *pdev) | |||
377 | spin_lock_init(&common->lock); | 378 | spin_lock_init(&common->lock); |
378 | common->dev = dev; | 379 | common->dev = dev; |
379 | 380 | ||
381 | pm_runtime_enable(dev); | ||
382 | pm_runtime_get_sync(dev); | ||
383 | |||
380 | irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); | 384 | irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); |
381 | if (irq) { | 385 | if (irq) { |
382 | int ret; | 386 | int ret; |
@@ -465,12 +469,16 @@ error_unregister: | |||
465 | rcar_thermal_irq_disable(priv); | 469 | rcar_thermal_irq_disable(priv); |
466 | } | 470 | } |
467 | 471 | ||
472 | pm_runtime_put_sync(dev); | ||
473 | pm_runtime_disable(dev); | ||
474 | |||
468 | return ret; | 475 | return ret; |
469 | } | 476 | } |
470 | 477 | ||
471 | static int rcar_thermal_remove(struct platform_device *pdev) | 478 | static int rcar_thermal_remove(struct platform_device *pdev) |
472 | { | 479 | { |
473 | struct rcar_thermal_common *common = platform_get_drvdata(pdev); | 480 | struct rcar_thermal_common *common = platform_get_drvdata(pdev); |
481 | struct device *dev = &pdev->dev; | ||
474 | struct rcar_thermal_priv *priv; | 482 | struct rcar_thermal_priv *priv; |
475 | 483 | ||
476 | rcar_thermal_for_each_priv(priv, common) { | 484 | rcar_thermal_for_each_priv(priv, common) { |
@@ -481,6 +489,9 @@ static int rcar_thermal_remove(struct platform_device *pdev) | |||
481 | 489 | ||
482 | platform_set_drvdata(pdev, NULL); | 490 | platform_set_drvdata(pdev, NULL); |
483 | 491 | ||
492 | pm_runtime_put_sync(dev); | ||
493 | pm_runtime_disable(dev); | ||
494 | |||
484 | return 0; | 495 | return 0; |
485 | } | 496 | } |
486 | 497 | ||