diff options
author | Geert Uytterhoeven <geert+renesas@glider.be> | 2015-03-18 14:55:56 -0400 |
---|---|---|
committer | Jason Cooper <jason@lakedaemon.net> | 2015-03-23 05:34:43 -0400 |
commit | 51b05f6b8a7dfa2c85988e506d3107144a13b975 (patch) | |
tree | af34871f56d52830c58730d82d996241cb1a0e6d /drivers/irqchip/irq-renesas-irqc.c | |
parent | 1cd5ec73306d6e361b90e27ae17bd5f87e009567 (diff) |
irqchip: renesas-irqc: Add minimal runtime PM support
This is just enough to let pm_clk_*() enable the functional clock, and
manage it for suspend/resume, if present.
Before, it was assumed enabled by the bootloader or reset state.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Link: https://lkml.kernel.org/r/1426704961-27322-3-git-send-email-geert+renesas@glider.be
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Diffstat (limited to 'drivers/irqchip/irq-renesas-irqc.c')
-rw-r--r-- | drivers/irqchip/irq-renesas-irqc.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/irqchip/irq-renesas-irqc.c b/drivers/irqchip/irq-renesas-irqc.c index 44fe04a8da95..2fe9612041b0 100644 --- a/drivers/irqchip/irq-renesas-irqc.c +++ b/drivers/irqchip/irq-renesas-irqc.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/slab.h> | 29 | #include <linux/slab.h> |
30 | #include <linux/module.h> | 30 | #include <linux/module.h> |
31 | #include <linux/platform_data/irq-renesas-irqc.h> | 31 | #include <linux/platform_data/irq-renesas-irqc.h> |
32 | #include <linux/pm_runtime.h> | ||
32 | 33 | ||
33 | #define IRQC_IRQ_MAX 32 /* maximum 32 interrupts per driver instance */ | 34 | #define IRQC_IRQ_MAX 32 /* maximum 32 interrupts per driver instance */ |
34 | 35 | ||
@@ -180,6 +181,9 @@ static int irqc_probe(struct platform_device *pdev) | |||
180 | p->pdev = pdev; | 181 | p->pdev = pdev; |
181 | platform_set_drvdata(pdev, p); | 182 | platform_set_drvdata(pdev, p); |
182 | 183 | ||
184 | pm_runtime_enable(&pdev->dev); | ||
185 | pm_runtime_get_sync(&pdev->dev); | ||
186 | |||
183 | /* get hold of manadatory IOMEM */ | 187 | /* get hold of manadatory IOMEM */ |
184 | io = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 188 | io = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
185 | if (!io) { | 189 | if (!io) { |
@@ -260,6 +264,8 @@ err3: | |||
260 | err2: | 264 | err2: |
261 | iounmap(p->iomem); | 265 | iounmap(p->iomem); |
262 | err1: | 266 | err1: |
267 | pm_runtime_put(&pdev->dev); | ||
268 | pm_runtime_disable(&pdev->dev); | ||
263 | kfree(p); | 269 | kfree(p); |
264 | err0: | 270 | err0: |
265 | return ret; | 271 | return ret; |
@@ -275,6 +281,8 @@ static int irqc_remove(struct platform_device *pdev) | |||
275 | 281 | ||
276 | irq_domain_remove(p->irq_domain); | 282 | irq_domain_remove(p->irq_domain); |
277 | iounmap(p->iomem); | 283 | iounmap(p->iomem); |
284 | pm_runtime_put(&pdev->dev); | ||
285 | pm_runtime_disable(&pdev->dev); | ||
278 | kfree(p); | 286 | kfree(p); |
279 | return 0; | 287 | return 0; |
280 | } | 288 | } |