diff options
author | Geert Uytterhoeven <geert+renesas@glider.be> | 2015-03-18 21:55:56 +0300 |
---|---|---|
committer | Jason Cooper <jason@lakedaemon.net> | 2015-03-23 12:34:43 +0300 |
commit | 51b05f6b8a7dfa2c85988e506d3107144a13b975 (patch) | |
tree | af34871f56d52830c58730d82d996241cb1a0e6d /drivers/irqchip/irq-renesas-irqc.c | |
parent | 1cd5ec73306d6e361b90e27ae17bd5f87e009567 (diff) | |
download | linux-51b05f6b8a7dfa2c85988e506d3107144a13b975.tar.xz |
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 @@ #include <linux/slab.h> #include <linux/module.h> #include <linux/platform_data/irq-renesas-irqc.h> +#include <linux/pm_runtime.h> #define IRQC_IRQ_MAX 32 /* maximum 32 interrupts per driver instance */ @@ -180,6 +181,9 @@ static int irqc_probe(struct platform_device *pdev) p->pdev = pdev; platform_set_drvdata(pdev, p); + pm_runtime_enable(&pdev->dev); + pm_runtime_get_sync(&pdev->dev); + /* get hold of manadatory IOMEM */ io = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!io) { @@ -260,6 +264,8 @@ err3: err2: iounmap(p->iomem); err1: + pm_runtime_put(&pdev->dev); + pm_runtime_disable(&pdev->dev); kfree(p); err0: return ret; @@ -275,6 +281,8 @@ static int irqc_remove(struct platform_device *pdev) irq_domain_remove(p->irq_domain); iounmap(p->iomem); + pm_runtime_put(&pdev->dev); + pm_runtime_disable(&pdev->dev); kfree(p); return 0; } |