Skip to content

Commit

Permalink
irqchip: renesas-irqc: Add minimal runtime PM support
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Geert Uytterhoeven authored and Jason Cooper committed Mar 23, 2015
1 parent 1cd5ec7 commit 51b05f6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/irqchip/irq-renesas-irqc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -260,6 +264,8 @@ static int irqc_probe(struct platform_device *pdev)
err2:
iounmap(p->iomem);
err1:
pm_runtime_put(&pdev->dev);
pm_runtime_disable(&pdev->dev);
kfree(p);
err0:
return ret;
Expand All @@ -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;
}
Expand Down

0 comments on commit 51b05f6

Please sign in to comment.